I need a simple LINUX script that will automatically
1. Create an EC2 AMI (using the CreateImage Web Service API from EC2)
2. Rotate backups of the AMI's for XX days
3. Send out email alerts with what backups were rotated
4. Send out email alerts on any failures
Note: Must use the EC2 API's with the CreateImage command and no other version.