Created
January 24, 2018 04:00
-
-
Save kidbrax/5df5b37cc30797b87401d8095621f929 to your computer and use it in GitHub Desktop.
Get ID of AMI created using Packer
This file contains 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
# assuming you use a manifest file such as: | |
# "post-processors": [ | |
# { | |
# "type": "manifest", | |
# "output": "manifest.json", | |
# "strip_path": true | |
# } | |
# ] | |
new_ami_id=$(cat manifest.json | jq -r '.builds | .[length-1].artifact_id' | cut -d ':' -f 2) | |
echo "New AMI is $new_ami_id" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment