Skip to content
Advertisement

How to delete an AMI using boto?

(cross posted to boto-users)

Given an image ID, how can I delete it using boto?

Advertisement

Answer

You use the deregister() API.

There are a few ways of getting the image id (i.e. you can list all images and search their properties, etc)

Here is a code fragment which will delete one of your existing AMIs (assuming it’s in the EU region)

JavaScript

(edit): and in fact having looked at the online documentation for 2.0, there is another way.

Having determined the image ID, you can use the deregister_image(image_id) method of boto.ec2.connection … which amounts to the same thing I guess.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement