How to delete EC2 AMI

amazon ec2amazon-web-services

I know that the command ec2-create-image instance-id will be creating an image of the ec2 instance, creating snapshots file and registering as an AMI. But what is the equivalent command to delete the image which will deleting associated snapshot files and de-registering AMI?

Best Answer

Updated answer from the aws docs:

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the navigation bar, verify your region.
  3. In the navigation panel, click AMIs.
  4. Select the AMI, click Actions, and then click Deregister. When prompted for confirmation, click Continue.
  5. In the navigation pane, click Snapshots.
  6. Select the snapshot, click Actions, and then click Delete. When prompted for confirmation, click Yes, Delete.

Hope this help anyone like me! :D