Created
June 20, 2018 05:00
-
-
Save ThakurPriyanka/3b45331e278a05819c96a6f77833b149 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
set -e | |
usage() { | |
echo "environment variable AWS_PROFILE or access keys (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to be set" | |
exit 1 | |
} | |
if [ ${#} -ne 2 ]; then | |
usage | |
fi | |
AWS_ACCESS_KEY=$1 | |
AWS_SECRET_KEY=$2 | |
run_packer() { | |
set -x | |
echo "enter into run packer" | |
packer build \ | |
-var aws_access_key=$1\ | |
-var aws_secret_key=$2\ | |
packer/demo-packer.json | |
set +x | |
} | |
run_packer $AWS_ACCESS_KEY $AWS_SECRET_KEY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment