Discover Images

Discover EC2 images (AMI) based on specified criteria.

Source codePermissions

Only images owned by the account are returned.

Usage

Input

Parameter Description Type Required Default Value
image_ids Image IDs to focus on list(string) No All images
public Get only publicly exposed images bool No False
exclude_aws_backup Exclude images managed by AWS Backup bool No False
created_before Get images created before date (YYYY/MM//DD) string No None
created_after Get images created after date (YYYY/MM//DD) string No None
region Region for operation. Leave blank for session default string No Session Default
debug Increase log verbosity bool No False
silent Decrease log verbosity bool No False
output Output format
table
string No None
session Established session object No None

Output

Returns a list of discovered image IDs:

['ami-1234567890abcdef0', 'ami-abcdef1234567890']

Examples

Fetch all images in eu-west-2:

aaws ec2 discover_images --region eu-west-2

Fetch images created before 2024/01/01 and not managed by AWS Backup:

aaws ec2 discover_images --exclude__aws_backup --created_before 2024/01/01