Skip to content

Instantly share code, notes, and snippets.

@yyolk
Forked from stefanteixeira/packer-ebs-snapshot-id
Created February 11, 2016 21:39
Show Gist options
  • Save yyolk/a19e227d7c39e87a0fa2 to your computer and use it in GitHub Desktop.
Save yyolk/a19e227d7c39e87a0fa2 to your computer and use it in GitHub Desktop.
Get EBS Snapshot ID from a Packer build
packer build -machine-readable packer.json | tee build.log
grep 'artifact,0,id' build.log | cut -d, -f6 | cut -d: -f2
packer build -machine-readable packer.json | tee build.log
grep 'Tagging snapshot' build.log | cut -d, -f5 | cut -d: -f3 | grep -o '[^$(printf '\t')].*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment