DEV Community

Ajeet Singh Raina
Ajeet Singh Raina

Posted on • Updated on

How to Clean Up Your AWS Resources in 5 Minutes?

Do you want to save your AWS bills? Look at "Nuke".

Cloud-Nuke is a tool for cleaning up your cloud accounts by nuking (deleting) all resources within it. It's open source tool and hosted under GITHUB

[**Caution: Please do note that this tool is not intended for the production environment]

Getting Started with Cloud Nuke

Pre-requisite

  • Ensure that you have aws configure configured.

Download

  • Linux System
wget https://github.com/gruntwork-io/cloud-nuke/releases/download/v0.1.24/cloud-nuke_linux_amd64
Enter fullscreen mode Exit fullscreen mode

If you're on MacOS, ensure that you pick up

wget https://github.com/gruntwork-io/cloud-nuke/releases/download/v0.1.24/cloud-nuke_darwin_amd64
Enter fullscreen mode Exit fullscreen mode

Move the binary to a folder on your PATH.

mv cloud-nuke_darwin_amd64 /usr/local/bin/cloud-nuke.
Enter fullscreen mode Exit fullscreen mode

Add execute permissions to the binary.

chmod u+x /usr/local/bin/cloud-nuke
Enter fullscreen mode Exit fullscreen mode

Test it installed correctly:

cloud-nuke --help.
Enter fullscreen mode Exit fullscreen mode

That's it. Run the below CLI to clean up the overall AWS resources.

sudo cloud-nuke aws
INFO[2020-12-23T11:33:42Z] The following resource types will be nuked:  
INFO[2020-12-23T11:33:42Z] - ami                                        
INFO[2020-12-23T11:33:42Z] - asg                                        
INFO[2020-12-23T11:33:42Z] - ebs                                        
INFO[2020-12-23T11:33:42Z] - ec2                                        
INFO[2020-12-23T11:33:42Z] - ecscluster                                 
INFO[2020-12-23T11:33:42Z] - ecsserv                                    
INFO[2020-12-23T11:33:42Z] - eip                                        
INFO[2020-12-23T11:33:42Z] - ekscluster                                 
INFO[2020-12-23T11:33:42Z] - elb                                        
INFO[2020-12-23T11:33:42Z] - elbv2                                      
INFO[2020-12-23T11:33:42Z] - lambda                                     
INFO[2020-12-23T11:33:42Z] - lc                                         
INFO[2020-12-23T11:33:42Z] - rds                                        
INFO[2020-12-23T11:33:42Z] - s3                                         
INFO[2020-12-23T11:33:42Z] - snap                                       
INFO[2020-12-23T11:33:43Z] Retrieving active AWS resources in [eu-north-1, ap-south-1, eu-west-3, eu-west-2, eu-west-1, ap-northeast-2, ap-northeast-1, sa-east-1, ca-central-1, ap-southeast-1, ap-southeast-2, eu-central-1, us-east-1, us-east-2, us-west-1, us-west-2] 
INFO[2020-12-23T11:33:43Z] Checking region [1/16]: eu-north-1  
Enter fullscreen mode Exit fullscreen mode

Alt Text

Top comments (0)