Trying to Determine Amazon EC2 instance creation date time

0 votes

Can I possibly determine when a particular EC2 instance was created using Boto?

http://boto.readthedocs.org/en/latest/ref/ec2.html is not at all helpful in this case because I need to find out the creation date of a particular set of EC2 instances.

May 29, 2018 in AWS by Cloud gunner
• 4,670 points
9,762 views

1 answer to this question.

0 votes

You can't find as such attribute called create_time for EC2 instance because only launch_time is available in it.
But yeah, you can use a Python code to know when was the volume created which in return gives you instance creation time, it gives the only volume attached while creating an instance

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


The alternative is using custom code. When you create instances with create_instances(), you can log the launch_time for given instance along with it's instance ID and name to some place like DynamoDB so that you can retrieve the "create times" whenever you want using the instance IDs.

answered May 29, 2018 by Flying geek
• 3,280 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

How to get the last stopped time & date of EC2 instance?

Hi@akhtar, To get the details of your last ...READ MORE

answered Jun 16, 2020 in AWS by MD
• 95,460 points
14,197 views
0 votes
1 answer
0 votes
1 answer

Amazon EC2 instance unable to resolve host.

Here is my checklist of things you ...READ MORE

answered Aug 23, 2018 in AWS by Archana
• 4,170 points
5,965 views
0 votes
1 answer

How to launch and configure an EMR cluster using boto

Boto and the underlying EMR API is ...READ MORE

answered Sep 12, 2018 in AWS by Priyaj
• 58,020 points
4,896 views
0 votes
1 answer
0 votes
1 answer

DynamoDB : The provided key element does not match the schema

The following applies to the Node.js AWS ...READ MORE

answered Nov 13, 2018 in AWS by Priyaj
• 58,020 points
32,395 views
+1 vote
4 answers

How do I cache my images which are stored in Amazon S3?

when caching ec2 instance these can be ...READ MORE

answered Oct 23, 2018 in AWS by Nabarupa
9,126 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP