$aws ec2 create-image --instance-id xxx --name yyy --description "zzzz" --no-reboot
This created AMI image of EC2 instance but did not created extra attached volume's snapshot !
So is there any method to backup EBS volumes at time of creating image ? or we have to create volume snapshot separately using
$ec2-create-snapshot i-xxxx
date
\n----------------------------------" aws ec2 describe-instances --filters Name=vpc-id,Values=vpc-xxx | awk '{ print $8 }' | sort -n | grep "i-" > /tmp/instanceid.txt echo "Starting the Daily AMI creation: " #To create AMI of from instance-iddate +%d%b%y
-$i" > /tmp/aminame.txt aws ec2 create-image --instance-id $i --name "cat /tmp/aminame.txt
" --description "This is created by ami-backup.sh" --no-reboot | grep -ir ami | awk '{print $4}' > /tmp/amiID.txt echo "AMI Name is:cat /tmp/aminame.txt
\n" done