Archives de catégorie : aws

Destroy AWS resources: cloud-nuke or aws-nuke?

So you’re working on a development account, and Terraform is stuck in a cycle, not allowing you to easily destroy the remaining resources? Enter the world of nuke CLIs !

cloud-nuke

At the time of writing, I used version v0.1.16

From Gruntwork, written in Go, will not destroy as many objects as aws-nuke; has been around since May 2017

If you’re using ~/.aws/credentials , choose (wisely!) the account alias (myenv-dev in my case) in there and then:

But actually, you’ll probably want to narrow the scope down to a single region; so you’d have to specify it in the command line:

If you call it with the list argument, aws --list-resource-types you’ll get a list of what resources are supported for deletion:

aws-nuke

At the time of writing, I used version v2.14.0

From rebuy.de, written in Ruby, will destroy many objects, if not all, supports filters, requires a config file; has been around since June 2016.

You’ll need to provide a config file; a minimal one can be something like this nuke.yml file

If you’re using ~/.aws/credentials , choose (wisely!) the account alias (myenv-dev in my case) in there and then:

If you call it with the list argument, resource-types , you’ll get a list of what resources are supported for deletion:

Conclusion

Well, if you need to delete everything and be able to filter some resources out, then I guess aws-nukeis the way to go!