A tool to delete old AWS Elastic Beanstalk Application Versions (and their source bundles in S3)
- Clean up older versions of Elastic Beanstalk applications. These versions take up your S3 storage.
- Allow you to specify the number of day that a version is considered old. The script will never delete a running version.
- You need to set your AWS ACCESS KEY ID and ACCESS KEY SECRET. Follow this guide to set them
- Your AWS ACCESS KEY should have respective permissions. The following ElasticBeanstalk permissions must be granted: DescribeApplicationVersions, DescribeEnvironments, DeleteApplicationVersions (if you want to do the actual clean up)
- AWS_REGION environment variable must be set. Default is us-east-1. You can also pass this value to global flag
--region
when runningebclean
- Clone the repository
- Install godep (https://github.com/tools/godep)
- Run
godep restore
- Run
go install
- Execute
ebclean help
in your terminal and follow the instruction there ebclean clean <beanstalk_application_name_>
will inspect, print out results and automatically clean up all old versions of the specified application. By default, it will delete all versions that were created earlier than 30 days from current time.
- No bulk clean-up. If you need to clean up old versions for multiple Elastic Beanstalk Applications, you need to do it one by one.
The project uses the following awesome open source libraries: