Bash Script to make AMI backup from EC2 instance with retention and delete old AMI if these doesn't be in use without downtime.
- You need install AWS Cli at your system.
- Configured AWS Cli. http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html .
- Script : aws-ec2-ami-backup-retention.sh with execute permissions.
- EC2_NAME: You can find your instance name at AWS Manage Console.
- RETENTION_DAYS: If you want to keep X days AMI backups.
- PROFILE: Your aws cli profile.
./aws-ec2-ami-backup-retention.sh instance-name 3 default