Please reference: Configuring the AWS CLI
2. Install Packer: Official Document
On Mac
brew install packer
On Ubuntu
# Download the latest precompiled binary, get the suitable package here: https://www.packer.io/downloads.html
# ex: https://releases.hashicorp.com/packer/1.3.2/packer_1.3.2_linux_amd64.zip
wget ${PACKAGE_URL}
# ex: packer_1.3.2_linux_amd64.zip
unzip ${PACKER_ZIP_FILE}
3. Install jq: Official Download website
On Mac
brew install jq
On Ubuntu
sudo apt-get install jq
OSX's sed is BSD version. In order to align the sed command on Ubuntu GNU version, please install gnu-sed. On Mac
brew install gnu-sed
init-packer.sh will check:
- Upstream Ubuntu official AMI
- Latest git commit hash
Command
bash init-packer.sh ${AWS_OWNER} ${AWS_REGION} ${UBUNTU_VERSION} ${AWS_VOLUME} ${AMI_ARCH}
Example
bash init-packer.sh 100005588888 ap-southeast-1 18.04 hvm:ebs-ssd amd64