Filtering AMI by name using aws-cli

12,200

From Listing and Filtering Using the CLI and API:

You can also use wildcards with the filter values. An asterisk (*) matches zero or more characters, and a question mark (?) matches exactly one character.

List any RHEL 7.x HVM GA images

aws ec2 describe-images --filters Name=name,Values=RHEL-7.?_HVM_GA*
Share:
12,200

Related videos on Youtube

Jedi
Author by

Jedi

Updated on September 18, 2022

Comments

  • Jedi
    Jedi almost 2 years

    Is there a way to filter public AMIs that contain a particular string (say abcd)?

    The command:

    aws ec2 describe-images --filters Name=name,Values=abcd
    

    returns only those AMIs that exactly match Name=abcd

  • TJ Biddle
    TJ Biddle almost 6 years
    Note: It must be Name=name and not Name=Name as this answer states; which is odd since if you run a describe-images it seems like it would be the other way around.