Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Forked from danrigsby/packer-ami-id
Created June 19, 2019 21:31
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 kmcquade/306ab0182f7161069310a1087501ed72 to your computer and use it in GitHub Desktop.
Save kmcquade/306ab0182f7161069310a1087501ed72 to your computer and use it in GitHub Desktop.
Get AMI ID from a packer build
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment