Running aws-nuke
Introduction
During the course of our trianing we have started multiple EC2 instances, worked with multiple RDS instances and created several S3 buckets as part of the training. You can continue to work with these resources or choose to terminate them as you will incur some charges if they are kept running.
What are we going to cover
In this chapter, we will cover the steps required to run a binary that will terminate your AWS assets.
Steps to complete this
First we have to download the aws-nuke linux binary from releases aws-nuke-v2.14.0-linux-amd64
Then update the permissions for the binary
Now we have to create the configuration file to perform the clean up of entire AWS account using aws-nuke.
Create a new file nuke-config.yml
with following information. Replace the "111111111111" with your account number. You can get this from aws sts get-caller-identity
Now to perform the operation we have to run the following. It returns the information about deleting from the account number given configuration.
If you see a message that tells you that there is no account alias created, you need to create an account alias using
Then to perform real delete operation it is required to add --no-dry-run
flag
It will prompt for twice to confirm before performing the delete operation
Additional References
Last updated