I am trying to find a AWS Snapshot associated with AMI.
I am cleaning up my AMI list. After deregistering 2 AMI I have checked snapshot count its not reducing any reason behind this?
How can delete snapshot associated with AMI automatically when I am deleting AMI?
When you deregister an Amazon EBS-backed AMI, it doesn't affect the snapshot that was created for the root volume of the instance during the AMI creation process. You'll continue to incur storage costs for this snapshot. Therefore, if you are finished with the snapshot, you should delete it.
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/deregister-ami.html
And for writing some automation script, which can auto delete snapshots when you are deleting the AMI, you can have a look on following:
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/