Skip to content

How do I find out which user launched an EC2 instance in my account?

1 minute read
1

I want to identify the user that launched an Amazon Elastic Compute Cloud (Amazon EC2) instance in my AWS account.

Resolution

Use AWS CloudTrail to view the last 90 days of recorded API activity and events in an AWS Region. When you view your CloudTrail event history, use attribute filters and a time range filter to narrow the results. Check the RunInstances action in the Event name column for your instance. Choose View event for event details such as the user that initiated the instance launch request.

If you don't know your instance ID, then complete the following steps to identify your ID:

  1. Open the Amazon EC2 console.
  2. In the navigation pane, choose Instances.
  3. Choose your instance, and then choose the Details tab.
  4. Note the Instance ID value.

Related information

How do I use CloudTrail to track API calls to my Amazon EC2 instances?

AWS OFFICIALUpdated 9 months ago
1 Comment

Thanks for the helpful article. I have a follow-up question:

What if the EC2 instances were** launched** more than 90 days ago? Since CloudTrail’s Event History only retains logs for the last 90 days, and I did not enable CloudTrail logging to an S3 bucket, I'm unable to retrieve older events.

I also have multiple IAM users and many EC2 instances across different regions, so it's becoming difficult to trace who launched which instance.

Is there any way to recover this information, or any AWS-native alternatives to identify the user who launched older instances without historical CloudTrail logs in S3?

replied 10 months ago