Last active
October 13, 2023 06:10
-
-
Save waltervargas/2f7cb41c003299d22f35227aedc166d0 to your computer and use it in GitHub Desktop.
Ansible Playbook to Delete AWS CloudFormation Stacks in Sequence from Command Line
This file contains hidden or 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
# Usage: ansible-playbook aws-cf-delete-stacks.yml -e '{"stacks": ["jenkins", "openvpn", "network", "iam"], "region": "us-west-2"}' | |
- hosts: localhost | |
gather_facts: no | |
connection: local | |
tasks: | |
- name: Delete Stacks | |
with_items: "{{ stacks }}" | |
cloudformation: | |
stack_name: "{{ item }}" | |
state: "absent" | |
region: "{{ region }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment