-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathsg_delete.yml
34 lines (34 loc) · 948 Bytes
/
sg_delete.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- hosts: localhost
connection: local
gather_facts: no
vars_files:
- staging_vpc_info
vars:
#your region
region: ap-southeast-2
#prefix for naming
prefix: staging
vpc_id: "{{ staging_vpc }}"
tasks:
- name: delete {{ prefix }}_sg_web
ec2_group:
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_web"
description: security group for webservers
state: absent
- name: delete {{ prefix }}_sg_database
ec2_group:
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_database"
description: security group for databases
state: absent
- name: delete {{ prefix }}_sg_nat
ec2_group:
region: "{{ region }}"
vpc_id: "{{ vpc_id }}"
name: "{{ prefix }}_sg_nat"
description: security group for nat
state: absent