Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created June 15, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rdhyee/bcf051fb626b377d294d to your computer and use it in GitHub Desktop.
Save rdhyee/bcf051fb626b377d294d to your computer and use it in GitHub Desktop.
A configuration files for creating a lightly modified AMI for ubuntu 12.04LTS
# to get my credentials in place --> to create env vars with my key/secret
source ~/ry_aws.sh
packer build \
-var aws_access_key=$AWS_ACCESS_KEY \
-var aws_secret_key=$AWS_SECRET_KEY \
packer_example_aws.json
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-de0d9eb7",
"instance_type": "t1.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-example {{timestamp}}"
}],
"provisioners": [{
"type": "shell",
"inline": [
"sleep 30",
"sudo apt-get update",
"sudo apt-get install -y redis-server"
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment