Skip to content

Instantly share code, notes, and snippets.

@waltervargas
Last active October 13, 2023 06:10
Show Gist options
  • Save waltervargas/2f7cb41c003299d22f35227aedc166d0 to your computer and use it in GitHub Desktop.
Save waltervargas/2f7cb41c003299d22f35227aedc166d0 to your computer and use it in GitHub Desktop.
Ansible Playbook to Delete AWS CloudFormation Stacks in Sequence from Command Line
# 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