· 9 years ago · Dec 12, 2016, 06:27 PM
1{
2 "variables": {
3 "aws_access_key_id": "{{env `AWS_ACCESS_KEY_ID` }}",
4 "aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY` }}",
5 "aws_region": "{{env `AWS_REGION` }}",
6 "ebs_optimized": "{{env `AMI_EBS_OPTIMIZED` }}",
7 "source_ami": "{{env `AWS_SOURCE_AMI` }}",
8 "instance_type": "{{env `AMI_INSTANCE_TYPE` }}",
9 "associate_public_ip_address": "{{env `AMI_ASSOCIATE_PUBLIC_IP_ADDRESS` }}",
10 "vpc_id": "{{env `AMI_VPC_ID` }}",
11 "subnet_id": "{{env `AMI_SUBNET_ID` }}",
12 "security_group_id": "{{ env `AWS_SECURITY_GROUP_ID` }",
13 "ami_name": "{{ env `AMI_NAME` }}",
14 "ci_build_ref": "{{ env `$CI_BUILD_REF` }}"
15 },
16 "builders": [
17 {
18 "type": "amazon-ebs",
19 "access_key": "{{user `aws_access_key_id` }}",
20 "secret_key": "{{user `aws_secret_key` }}",
21 "ami_regions": "{{user `aws_region` }}",
22 "source_ami": "{{user `source_ami` }}",
23 "ami_name": "{{user `ami_name` }}",
24 "ami_description": "Image with docker engine and TODO express images",
25 "region": "{{user `aws_region` }}",
26 "ebs_optimized": "{{ user `aim_ebs_optimized` }}",
27 "instance_type": "{{ user `instance_type` }}",
28 "associate_public_ip_address": "{{ user `associate_public_ip_address` }}",
29 "vpc_id": "{{user `vpc_id` }}",
30 "subnet_id": "{{user `subnet_id` }}",
31 "ssh_username": "{{user `ssh_username` }}",
32 "security_group_id": "{{user `security_group_id` }}",
33 "ssh_keypair_name": "packer-key",
34 "ssh_private_key_file": "./packer-key.pem",
35 "tags":
36 {
37 "Group": "TechTalk",
38 "Name": "TechTalk-TODO-App",
39 "SHA1": "{{user `ci_build_ref` }}"
40 }
41 }
42 ],
43
44 "provisioners" : [
45 { "type": "chef-solo",
46 "cookbook_paths": [ "vendor/cookbooks" ],
47 "run_list": [ "techtalk::default" ]
48 }
49 ]
50}