Created
October 27, 2017 16:19
-
-
Save jwieringa/d622c06bf3d0a705088ccf6e245580f9 to your computer and use it in GitHub Desktop.
Find an AMI ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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