Gaurav Desai:
I am trying to find a way to be able to gather inventory in form of public ips for EC2, Loadbalancers and RDS respectively and save it under designated s3 bucket. Can someone helo?
Alistair Mackay:
I can give you the outline for what you would have to script, using language of your choice (Python, PowerShell etc)
- Find all public subnets - these being ones that have an associated route table that has an Internet Gateway in it
- Find all ENI that are attached to any of these subnets. Such ENI will have public IPs.
- To find what the infrastructure is, you need to then check the attachments for these ENIs