Created
January 15, 2018 16:49
-
-
Save Pierozi/f2201290470acb0707d1535900bf9729 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"variables": { | |
"profile" : "{{env `AWS_PROFILE`}}", | |
"region" : "{{env `AWS_REGION`}}", | |
"build_vpc" : "{{env `VPC_ID`}}", | |
"build_subnet" : "{{env `SUBNET_ID`}}", | |
"build_instance_type" : "{{env `AWS_INSTANCE_TYPE`}}", | |
"source_ami" : "{{env `AWS_SOURCE_AMI`}}", | |
"distribution" : "Amazon Linux", | |
"distribution_user" : "{{env `AWS_AMI_USER`}}", | |
"cookbook_version" : "0.0.0" | |
}, | |
"builders": [{ | |
"type" : "amazon-ebs", | |
"force_deregister" : true, | |
"force_delete_snapshot" : true, | |
"associate_public_ip_address" : true, | |
"profile" : "{{user `profile`}}", | |
"region" : "{{user `region`}}", | |
"vpc_id" : "{{user `build_vpc`}}", | |
"subnet_id" : "{{user `build_subnet`}}", | |
"instance_type" : "{{user `build_instance_type`}}", | |
"source_ami" : "{{user `source_ami`}}", | |
"ssh_username" : "{{user `distribution_user`}}", | |
"ami_name" : "my-packer-ami-{{timestamp}}", | |
"ami_description" : "cron {{user `distribution`}} with php7.0,nginx", | |
"ami_users" : [ "11100001000", "2220300003333", "4550666666" ], | |
"tags": { | |
"Name" : "vendor-my-instance", | |
"cookbook_version" : "{{user `cookbook_version`}}", | |
"SourceAmi" : "{{user `source_ami`}}" | |
}, | |
"run_tags" : { | |
"Name" : "Packer Builder Instance", | |
"cookbook_version" : "{{user `cookbook_version`}}", | |
"SourceAmi" : "{{user `source_ami`}}" | |
} | |
}], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"inline": ["yum update && yum -y install curl"] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment