Back
Is there a way to find out Amazon EC2 AMI creation date/time from AWS Console or command line?
Note: I am not looking for instance creation, rather when was a particular AMI created?
You can use the describe-images for getting it. Use this:
CreationDate -> (string)
The date and time the image was created and for more information and explanation check out this documentation - https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html.
Sample describe-tags command:
aws ec2 describe-images --filters "Name=tag:Custom,Values=Linux1" --query 'Images[*].{ID:ImageId}'
If not, you can use this python code snippet to get it:
import boto3ec2 = boto3.resource('ec2', region_name='instance_region_name')volume = ec2.Volume('vol-id')print volume.create_time.strftime("%Y-%m-%d %H:%M:%S")
import boto3
ec2 = boto3.resource('ec2', region_name='instance_region_name')
volume = ec2.Volume('vol-id')
print volume.create_time.strftime("%Y-%m-%d %H:%M:%S")
Learn how we helped 50,000+ professionals like you !
31k questions
32.8k answers
501 comments
693 users