} ], "builders": [ { "access_key": "{{user `ec2_access_key`}}", "source_ami": "ami-1234567", "account_id": "1234", "bundle_destination": "/mnt", "region": "{{user `region`}}", "tags": { "application": "myapp", "environment": "test", "release": "precise", "host": "packerci-slave001", "owner": "root", "ancestor": "ami-34567890" }, "user_data": "#cloud-config\nrole: myapp", "x509_key_path": "{{user `ec2_private_key`}}", "instance_type": "{{user `size`}}", "x509_upload_path": "/mnt", "x509_cert_path": "{{user `ec2_cert`}}", "iam_instance_profile": "provisioning", "ami_name": "{{user `application`}}-{{user `version`}}.{{user `build_number`}}-{{user `architecture`}}-{{user `user_timestamp`}}-{{user `type`}}", "ami_description": "store=amazon-instance,ancestor_name=golden-12.04-precise-amd64-201311010411- instance_store,ancestor_id=ami-12345678,version=0.1,env=test,app=myapp,release=precise", "secret_key": "{{user `ec2_secret_key`}}", "security_group_id": "sg-12345678", "type": "amazon-instance", "s3_bucket": "mybucket", "ssh_timeout": "15m" } ] } Packer.json - Example of packer.json output. JSON configuration with a lot of options - Has variable substitution for environment variables. - Supports a lot of options, such as ‘instance-store’, EBS, or chroot builds. - We call a single script ‘provision.sh’ when the instance launches. - Script waits for CloudInit to drop a file telling the system that puppet has finished. - We then use our tests at this point to determine if we have a successful build. Puppet has converged, etc.. - If successful, the script then cleans up temporary data. SSH keys, log files, /etc/hosts if managed, CloudInit data