Skip to content

Instantly share code, notes, and snippets.

@johanforssell
Last active April 19, 2023 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanforssell/5acf08171cd65f5b6649734962ddb4f4 to your computer and use it in GitHub Desktop.
Save johanforssell/5acf08171cd65f5b6649734962ddb4f4 to your computer and use it in GitHub Desktop.
List all private EC2 AMI whose name begins with the string `workload`
#!/bin/sh
# List all private EC2 AMI whose name begins with the string `workload`
# Present the output as a table
aws ec2 describe-images \
--query 'Images[*].{created:CreationDate,ami:ImageId,name:Name}' \
--filters "Name=name,Values=workload*" "Name=image-type,Values=machine" "Name=is-public,Values=false" \
--output table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment