Created
January 23, 2020 13:36
-
-
Save mak3r/2ec3ad30a0edd32c5f1f1a81ca196777 to your computer and use it in GitHub Desktop.
Get the AMI for ubuntu bionic 18.04
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
#!/bin/sh | |
# based on this https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html#finding-an-ami-aws-cli | |
aws ec2 describe-images --owners 099720109477 --filters 'Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????' 'Name=state,Values=available' --query 'reverse(sort_by(Images, &CreationDate))[:1].ImageId' --output text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment