0 votes
1 view
in AWS by (19.2k points)

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?

1 Answer

0 votes
by (44.6k points)

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 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")

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 8, 2019 in AWS by Amyra (8.9k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...