A simple Go command line tool that cleans up obsolete amis and snapshots, and replace ecs cluster instances with newest AMI.
make install
rmi
delete images before specified generations.rms
remove snapshots that is not reffered by any AMIs or volumes.rpl
replace ecs cluster instances with newest AMI.
-
rmi
image,i
prefix of AMI.owner,o
account ID of ami owner.dry-run,d
dry run flag.gen,g
max generations to retain.verbose,v
enable debug output.
-
rms
owner,o
account ID of ami owner.dry-run,d
dry run flag.verbose,v
enable debug output.
-
rpl
asgname
asg name.clustername
ecs cluster name.image,i
prefix of AMI.owner,o
account ID of ami owner.dry-run,d
dry run flag.verbose,v
enable debug output.
Delete amis older than specified generations.
ami-replacer rmi --image <image name> --owner <owner> --gen=<generation> --dry-run
Delete unused snapshots.
ami-replacer rms --owner <owner> --dry-run
Replace ECS cluster Instances with newest AMI.
ami-replacer replace --image <image name> --owner <owner> --asgname <asg name> --clustername <cluster name> -v --dry-run
- First beta release
Feel free to help out by sending pull requests or by creating new issues.
Tetsuhito Yasuno(tyasuno)
MIT