At the time of this posting, there's no way to find that. However, what you can find is a list of all your snapshots, the date they were made and the AMI they were based on. So if you've made at least one snapshot of the AMI at some point, you logically know that the AMI was created on or before that date.
Now how do we get a list of our snapshots, sorted by date or AMI? Like this:
aws ec2 describe-snapshots --owner-ids MyAWSaccountIDgoesHere --query 'Snapshots[*].[Description,StartTime]' --output text | sort -k8n,8 | cut -d' ' -f5,7 > ami-snapshot-dates_sorted-by-date.txt |
If you want to get a list sorted by AMI, you'd do this:
aws ec2 describe-snapshots --owner-ids MyAWSaccountIDgoesHere --query 'Snapshots[*].[Description,StartTime]' --output text | sort -k5n,5 | cut -d' ' -f5,7 > ami-snapshot-dates_sorted-by-ami.txt |
Hint: If you're feeling lazy and don't want to look up your AWS account ID, (presuming that you're the root user), you can use "--owner self" instead of "--owner-ids MyAWSaccountIDgoesHere"
No comments:
Post a Comment