When I delete an Amazon Elastic Block Store (Amazon EBS) snapshot in my Amazon Elastic Compute Cloud (Amazon EC2) instance, I get the following error: “Failed to deregister the AMI ami-xxxxx. API error: "Not authorized for image:ami- xxxxx""
Resolution
The error message is received when you try to delete an EBS snapshot that is created by an Amazon Machine Image (AMI). When a snapshot is linked to an AMI, the AMI must be deregistered before the snapshot can be deleted.
To delete an EBS snapshot that's linked to an AMI, complete the following steps:
- Clean up your Amazon EBS-backed AMI.
- Delete the EBS snapshot.