How to find out information about an EC2 instance from AMI id?

我们两清 提交于 2019-12-11 03:46:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!