问题
This gives me information about all the snapshots I have:
aws ec2 describe-snapshots
From this, I can extract AMI id and find out more about the ami using:
aws ec2 describe-images --image-ids "ami-xxxxxxxx"
My question is, can we relate the ami id and instance that are using that ami id and find more information about it?
回答1:
Run describe-instances
with the image-id
aws ec2 describe-instances --filters "Name=image-id,Values=ami-xxxxxxx"
For text output:
aws ec2 describe-instances --filters "Name=image-id,Values=ami-xxxxxxx" --output text
来源:https://stackoverflow.com/questions/45595119/how-to-find-out-information-about-an-ec2-instance-from-ami-id