TL;DR: Packer + checksums = 👍
corey@gumgum.com
-debug
Packer JSON
AMI config paths
AMI ID
Get list of all
config files
Sort list
Calculate SHA1 of each file
Calculate SHA1 of list of file SHA1s
= ami_config_checksum
Does an
AMI exist with that
ami_config_checksum
?
Build new AMI
Return existing AMI
No
Yes
New stage
Updated stage
https://github.com/mechtron/ami-bakery
docker run --rm -t \
-e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION \
-e AWS_SUBNET_ID=$AWS_SUBNET_ID \
-e PACKER_JSON_PATH=`pwd`/example-app/ami/packer/ami.json \
-e AMI_DEFINITION_DIRS=`pwd`/example-app/ami/ \
--mount type=bind,source=`pwd`,target=`pwd` \
--mount type=bind,source=$HOME/.aws/,target=/root/.aws \
docker.io/mechtron/ami-bakery:latest