0

I have a VPC that I would like to export all the instance data from the API into a text file, how can I do this?

I am familiar with using awscli, boto, ansible, for creating things in AWS but getting back a master list of the data seems to be impossible on the documentation to get everything that exists in the VPC, such as EBS volumes, EC2 instances, security groups, etc? Any ideas?

  • Can you please clarify exactly what you want. A list of ec2 instance IDs? The user data for all your EC2 instances? Some kind of information about everything that exists in your VPC, such as EBS volumes, EC2 instances, security groups, etc? – Tim Sep 12 '16 at 20:17
  • There is no command in the CLI that can aggregate all that information. You have to first describe VPC's and then use other commands to fill in the gaps you need. – Juan Jimenez Sep 06 '18 at 09:36

2 Answers2

0

If all you're interested in is your EC2 instances, you can get this easily with:

$ aws ec2 describe-instances

If you're interested in more than this, consider using the Cloudformer tool. This tool can inspect your entire account and build an Cloudformation-compatible manifest of everything it sees.

EEAA
  • 109,363
  • 18
  • 175
  • 245
0

If you are looking for a pure Ansible solution you might want to check *_facts modules for AWS:

However if your goal is to get a simple list of your AWS facts you are better off using the aws cli as suggested by @EEAA

Henrik Pingel
  • 9,380
  • 2
  • 28
  • 39