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,280 points
2,576 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,160 points

Related Questions In AWS

0 votes
1 answer
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,090 points
612 views
0 votes
1 answer

Unable to initiate ssh connection to Amazon EC2 instance

The keypair which you are using must ...READ MORE

answered Sep 5, 2018 in AWS by Archana
• 4,090 points
44 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
• 56,940 points
1,285 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
• 56,940 points
3,867 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
954 views