Last active
August 24, 2021 20:57
-
-
Save nleiva/1fee0fbd0a2de46cd45aea92325d35a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Gather information about all Security Groups in Environment {{ ec2_environment }} | |
amazon.aws.ec2_group_info: | |
region: "{{ ec2_region }}" | |
filters: | |
vpc-id: "{{ all_vpcs.vpcs[0].vpc_id }}" | |
register: all_sg | |
- name: Delete Security Groups in VPC {{ all_vpcs.vpcs[0].vpc_id }} by ID | |
amazon.aws.ec2_group: | |
region: "{{ ec2_region }}" | |
group_id: "{{ item.group_id }}" | |
state: absent | |
loop: "{{ all_sg.security_groups }}" | |
when: item.group_name != "default" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment