Skip to content

Instantly share code, notes, and snippets.

@jwieringa
Created October 27, 2017 16:19
Show Gist options
  • Save jwieringa/d622c06bf3d0a705088ccf6e245580f9 to your computer and use it in GitHub Desktop.
Save jwieringa/d622c06bf3d0a705088ccf6e245580f9 to your computer and use it in GitHub Desktop.
Find an AMI ID
SOURCE_IMAGE=$(docker run \
-e AWS_DEFAULT_PROFILE=${AWS_DEFAULT_PROFILE} \
-v $HOME/.aws:/root/.aws \
--rm quay.io/coreos/awscli:latest \
aws --region "us-east-1" \
ec2 describe-images \
--filters \
Name=tag:Env,Values=default \
Name=tag:Project,Values=mine \
Name=tag:Role,Values=mine \
--query 'Images[*].{ID:ImageId}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment