Skip to content

Instantly share code, notes, and snippets.

@schmiddy
Created February 16, 2019 20:38
Show Gist options
  • Save schmiddy/af31feb84ac088c73f2c37c13da228e7 to your computer and use it in GitHub Desktop.
Save schmiddy/af31feb84ac088c73f2c37c13da228e7 to your computer and use it in GitHub Desktop.
example packer template with instance_type being a user variable
{
"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_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"instance_type": "{{user `instance_type`}}",
"ssh_username": "ubuntu",
"ami_name": "packer-example {{timestamp}}"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment