简体   繁体   中英

Can I get metadata from an EC2 that was not made in CloudFormation?

I have instances that were not created by CloudFormation. I am hoping to replicate those instances but I do not want to go through the whole brain numbing process of building the instances in EC2 (going through the steps of specifying the instance type, EBS volumes, etc.). My questions are:

  • Is there a way to get ALL the metadata of the EC2 instance from the AWS CLI in a JSON format that I can pass off to a creation of a new stack?

  • If so, can someone provide references in doing so?

  • If the CLI is not an option, is there any way of going through the AWS console to get this information?

It would be so cool if they had a way of doing some kind of JSON dump similar to a database dump.

You could start with:

aws ec2 describe-instances \
    --instance-ids "i-06666777788889999" \
    --query "Reservations[0]"

You'd then also probably want to get details of attached EBS volumes, Security Groups etc.

Alternatively, see if CloudFormer can help you. It can create a CloudFormation template from AWS resources that you point it at.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM