Skip to content

Instantly share code, notes, and snippets.

@mbairagi85
Created December 28, 2018 07:22
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 mbairagi85/63c746ed33c17c267b3660aaaa5b5db4 to your computer and use it in GitHub Desktop.
Save mbairagi85/63c746ed33c17c267b3660aaaa5b5db4 to your computer and use it in GitHub Desktop.
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
"aws_region": "{{env `REGION`}}",
"aws_source_ami": "{{env `AMI`}}",
"aws_instance_type": "t2.medium",
"organization": "{{env `ORGANIZATION`}}",
"ssh_username": "{{env `MAIN_USER`}}"
},
"builders": [{
"name": "knoldus-blog",
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"source_ami": "{{user `aws_source_ami`}}",
"instance_type": "{{user `aws_instance_type`}}",
"ami_name": "{{user `organization`}}-blog",
"ssh_username": "{{user `ssh_username`}}",
"ssh_pty": "true",
"tags": {
"Name": "{{user `orgazination`}}-blog",
"Role": "Packer Image",
"BuildDate": "{{isotime}}"
}
}],
"provisioners": [{
"type": "shell",
"script": "demo-script.sh",
"environment_vars": [
"AWS_ACCESS_KEY={{user `aws_access_key`}}",
"AWS_SECRET_KEY={{user `aws_secret_key`}}",
"AWS_DEFAULT_REGION={{user `aws_region`}}"
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment