Is there a way to find out AMI's associated with an Instance?
Like for example, I have test_instance. I would like to find out AMI's that have been generated with this instance.
So, basically I am trying to terminate the instance and all the AMI's and volumes associated with it.
答案 0 :(得分:0)
When you terminate instance, by default root volume is deleted (can be changed by DeleteOnTermination proerty) but any additional EBS volumes that you attach at launch, or any EBS volumes that you attach to an existing instance persist even after the instance terminates. So, if you have only root volume, and DeleteOnTermination set to true, you can just terminate the instance and volume will be deleted. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html For the AMI, if you used a public/AWS provided AMI, you cannot delete that. If you are using your own AMI, you have to deregister the AMI and delete the snapshot used to create the AMI. http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-deleting-snapshot.html