AWS 如何找到与 AMI 关联的快照?

AWS how to find Snapshot associated with AMI?

我正在尝试查找与 AMI 关联的 AWS 快照。

我正在清理我的 AMI 列表。注销 2 个 AMI 后,我检查了快照计数,它没有减少这背后的任何原因?

如何在删除AMI时自动删除与AMI关联的快照?

当您注销 Amazon EBS 支持的 AMI 时,它不会影响在 AMI 创建过程中为实例的根卷创建的快照。您将继续为此快照产生存储费用。因此,如果您已完成快照,则应将其删除。

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html

还有写一些自动化脚本,可以在删除AMI的时候自动删除快照,可以看下面:

https://serverfault.com/questions/611831/find-all-snapshots-created-by-ami-where-ami-is-deleted

https://www.yobyot.com/aws/deregister-an-aws-ami-and-remove-associated-s3-snapshots/2014/10/30/

http://www.n2ws.com/how-to-guides/how-to-delete-unutilized-ebs-based-amis-and-corresponding-snapshots.html