11

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

Jedi
  • 458
  • 1
  • 5
  • 20

1 Answers1

15

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*
jscott
  • 24,484
  • 8
  • 79
  • 100
  • 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. – TJ Biddle Jul 09 '18 at 18:21