Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ip of terminated instance in AWS

I am looking at cloud trail logs , I could only see the instance id of the terminated instances. I have a requirement of fetching the ip(not instance id) that was assigned to a machine which has got terminated. I need this information for the machines those got terminated in last 1 hour. Is there a way I can get that by making API calls?

like image 265
Ishu Gupta Avatar asked Feb 03 '26 19:02

Ishu Gupta


1 Answers

Using CloudTrail, I was able to search for ResourceName = i-0123abc and find the RunInstances event that had the ip in the event map under the following key tree: responseElements.instancesSet.items[0].privateIpAddress

like image 94
Kris O'Mealy Avatar answered Feb 06 '26 12:02

Kris O'Mealy