Scroll to navigation

ec2removeimg(1) General Commands Manual ec2removeimg(1)


ec2removeimg - Remove images in EC2


ec2removeimg [option]


ec2removeimg Remove an image in EC2 by deregistering the AMI and deleting the associated snapshot.


Specifies the account to use to connect to EC2. The account is specified in the config file ~/.ec2utils.conf. The account is specified as a section with [account-ACCOUNT_NAME] delimiter. The options of the sections are: access_key_id secret_access_key ssh_key_name and ssh_private_key. This allows the program to connect to EC2. If the access_key_id and/or secret_access_key are not found in ~/.ec2utils.conf, the search will use the ACCOUNT_NAME to look for a matching section [profile ACCOUNT_NAME] in ~/.aws/config or [ACCOUNT_NAME] in ~/.aws/credentials. Only the access_key_id and secret_access_key options are used by this tool.
Specifies the AWS access key and overrides the value given for the account with the access_key_id in the configuration file.
Deletes all images that match the criteria for image lookup. By default the tool will only delete an image if there is a singular match.
The program will not perform any action. It will provide information on stdout about the actions it would perform.
Specifies the configuration file to use. The default is ~/.ec2utils.conf.
Specify the AMI ID of the image to be removed. This option is mutually exclusive with the --image-name, --image-name-frag, and --image-name-match.
Specify the name of the image to be removed. The program will look for an exact match of the name. This option is mutually exclusive with --image-id, --image-name-frag, and --image-name-match.
Specify a section of an image name for the image(s) to be removed. Every image that matches the name fragment will be removed. This option is mutually exclusive with --image-id, --image-name, and --image-name-match.
Specify a regular expression to match an image name. Every image matching the regular expression will be removed. This option is mutually exclusive with --image-id, --image-name, and --image-name-frag.
Delete the image without waiting for confirmation input. This will only delete the image without confirmation if there is a unique match of the image selection criteria given or if the --all option is specified, all matches will be deleted.
This options will preserve the snapshot associated with the AMI.
A comma separated list of Amazon EC2 regions, or a single region. If no region argument is specified all EC2 connected regions will be processed. EC2 disconnected regions have different API keys and thus the specified account would not work with the disconnected regions. If a disconnected region is to be processed specify the region explicitly on the command line, and only the region of interest along with the matching account.
Specifies the AWS secret access key and overrides the value given for the account with the secret_access_key in the configuration file.
Print extra output about the operations performed to STDOUT.
Print the version of he program


ec2removeimg --account example --image-name-match v15 --all --no-confirm --verbose

Will delete all images in all connected regions that match the v15 regular expression in the image name. All associated snapshots will be deleted as well, no confirmation of the delete operation is required by the user and progress will be written to STDOUT.


SUSE Public Cloud Team (