Skip to content

Terminate/Delete resources in your AWS account to get a clean slate.

License

Notifications You must be signed in to change notification settings

enquizit/aws-cleanup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-cleanup

This project helps to terminate/delete all the resources in a given AWS account.

This is particularly useful if you are learning to work with AWS & don't want to accidentally leave any service in running state only to find out that you have been charged on your credit card at month end.

Installing

You would require node.js installed on your system to use aws-cleanup. In case its not already installed, you can get it from here: http://nodejs.org/

You can get the code & required modules (including AWS-SDK for node.js) by executing the following commands

git clone https://github.com/hsachdevah/aws-cleanup.git
cd aws-cleanup
npm install

You can execute the cleanup task by running cleanup.js. You would be asked to provide access-key & secret-access-key, please make sure you have all the required permissions for terminating/deleting resources.

node cleanup.js

Note: You can also store credentials locally so you don't have to enter them every time you execute the cleanup task. Create a file with name "aws-credentials.json" in the same directory as cleanup.js with the following content

{ 
	"accessKeyId": "<your AWS access key>", 
	"secretAccessKey": "<your AWS secret key>", 
	"region": "us-east-1" 
}

The given access key & secret key should have all the permissions to list/delete AWS resources.

Supported Services

The following services are supported in latest version:

Service Name Notes
EC2Only instances with status 'running' will get terminated.
EC2Only volumes with status 'available' will get deleted.
Elastic IPOnly EIPs with scope 'vpc' will get released
AutoScalingGroupsSets Desired Capacity to 0
ELB
RDSOnly DB instances with status 'available' will get deleted

About

Terminate/Delete resources in your AWS account to get a clean slate.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%