MyNixOS website logo
Description

Recursively delete CloudFormation stacks and their dependants.

This simple tool will repeatedly query CloudFormation stacks for outputs, and see if any other stacks are importing those. This is to make it easier to tear down CFn stacks which have many other stacks depending on their outputs.

forest-fire Build Status

This is a little command-line tool with an ill-advised name, to easily tear down CloudFormation stacks which have outputs that other stacks depend on. In the AWS Console this is rather annoying, since you have to manually chase up dependencies.

This tool simply interrogates the aws-cli tool about the stack you're trying to delete, finds out its outputs, and checks whether any currently-active stacks are importing them. The output is a dependency tree, which trivially tells us the order of deletion for it to succeed. If you're feeling adventurous, you may also let forest-fire do the actual deletion for you.

Installation

Prerequisites for hacking

You'll need the following installed and available to be able to hack on this software:

Haskell Stack

You'll want to install Stack using your local package manager (yes, it's available on Homebrew as haskell-stack), or if you're adventurous, using their curl | bash method...

You'll need to add ~/.local/bin to your $PATH.

AWS CLI interface

I'm guessing that this is a thing you'll already have.

Instructions

If you're not interested in hacking on this project, you can simply download and install it. Run:

cabal update; cabal install forest-fire

Usage

If you simply run the tool without arguments, it'll print usage information. Here's the down-low, however.

Find out what depends on a stack

Note that this performs a dry run (read-only). The dependency tree will be printed, along with the order in which you'd have to perform deletions, but nothing will be executed.

forest-fire "kubernetes-dynamic-91acf0ef-lifecycle"

Perform the deletions if you're satisfied with the tree

forest-fire "kubernetes-dynamic-91acf0ef-lifecycle" --delete

Do you Docker?

Some people don't believe in native executables. For them, i present the Docker version:

docker container run --rm \
    -e AWS_SECRET_ACCESS_KEY \
    -e AWS_ACCESS_KEY_ID \
    -e AWS_DEFAULT_REGION \
    paulrb/forest-fire:master yourstack

It is hosted on Docker Hub: https://hub.docker.com/r/paulrb/forest-fire and built with Travis CI: https://travis-ci.org/toothbrush/forest-fire from this repository.

Credits

Thanks Redbubble, i totally should've been doing other things instead of shaving this yak.

Metadata

Version

0.3

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows