-
Notifications
You must be signed in to change notification settings - Fork 2
/
hug-packer-single-aws-builder.json
53 lines (52 loc) · 1.68 KB
/
hug-packer-single-aws-builder.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY_ID`}}",
"aws_secret_key": "{{env `AWS_SECRET_ACCESS_KEY`}}",
"pkr_ami_version": "{{env `PACKER_AMI_VERSION`}}"
},
"builders": [{
"type": "amazon-ebs",
"name": "packer-demo-centos75",
"ami_regions": [
"us-east-1"
],
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"instance_type": "t2.medium",
"region": "us-east-1",
"subnet_id": "subnet-6f35060b",
"vpc_id": "vpc-6b51a910",
"ami_name": "hug-packer-demo-centos75-x86_64",
"ami_users": ["224626395331"],
"associate_public_ip_address": true,
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"name": "x86_64-CentOS_7-base-ami-master-patch-2019-08-19-2213",
"root-device-type": "ebs"
},
"owners": ["374168611083"],
"most_recent": true
},
"force_deregister": true,
"force_delete_snapshot": true,
"ssh_username": "centos",
"tags": {
"Name": "HUG Packer Demo AMI Instance",
"Source AMI ID": "{{ .SourceAMI }}",
"Version": "{{user `pkr_ami_version`}}"
}
}],
"provisioners": [
{
"type": "shell",
"inline": [
"echo 'Setting the timezone to EST/EDT time'",
"sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime",
"echo 'Install and start nginx'",
"sudo yum install nginx -y",
"echo 'All Done'"
]
}
]
}