-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacker.json
69 lines (69 loc) · 1.6 KB
/
packer.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"environmentName": "dev",
"region": "{{env `AWS_REGION`}}"
},
"builders": [
{
"type": "amazon-ebs",
"vpc_filter": {
"filters": {
"tag:Name": "vpc-{{user `environmentName`}}",
"isDefault": "false"
}
},
"subnet_filter": {
"filters": {
"tag:Name": "wordpress-vpc-{{user `environmentName`}}/VPC/Public-Subnet1"
},
"most_free": true,
"random": false
},
"region": "{{user `AWS_REGION`}}",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"architecture": "x86_64",
"name": "*amzn2-ami-hvm-2.0*-x86_64-gp2",
"root-device-type": "ebs"
},
"owners": [
"137112412989"
],
"most_recent": true
},
"source_ami": "{{user `ami`}}",
"instance_type": "t2.small",
"ssh_username": "ec2-user",
"ami_name": "uchicago-mysql-{{timestamp}}",
"run_tags": {
"Name": "packer-build-mysql"
},
"tags": {
"Name": "wordpress-mysql-db",
"Type": "uchicago-mysql"
}
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "{{ .Vars }} sudo -E /bin/bash '{{ .Path }}'",
"environment_vars": [
"MYSQL_ROOT_PASSWORD={{user `mysqlRootPassword`}}"
],
"scripts": [
"install_mysql.sh"
]
}
],
"post-processors": [
{
"type": "manifest",
"output": "manifest.json",
"strip_path": true
}
]
}