Skip to content

Instantly share code, notes, and snippets.

@SeongJuMoon
Forked from danrigsby/packer-ami-id
Created December 18, 2019 01:20
Show Gist options
  • Select an option

  • Save SeongJuMoon/64f44ece082e080f6d8267627fa25878 to your computer and use it in GitHub Desktop.

Select an option

Save SeongJuMoon/64f44ece082e080f6d8267627fa25878 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