forked from gruntwork-io/infrastructure-as-code-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-web-server.json
44 lines (44 loc) · 1.18 KB
/
simple-web-server.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
{
"variables": {
"region": "us-east-2"
},
"builders": [{
"ami_name": "gruntwork-packer-training-rails-{{isotime | clean_resource_name}}",
"ami_description": "An Ubuntu AMI that has Ruby on Rails installed.",
"instance_type": "t2.micro",
"region": "{{user `region`}}",
"type": "amazon-ebs",
"source_ami_filter": {
"filters": {
"virtualization-type": "hvm",
"architecture": "x86_64",
"name": "*ubuntu-xenial-16.04-amd64-server-*",
"block-device-mapping.volume-type": "gp2",
"root-device-type": "ebs"
},
"owners": ["099720109477"],
"most_recent": true
},
"ssh_username": "ubuntu"
}],
"provisioners": [{
"type": "shell",
"inline": [
"echo 'Sleeping for 30 seconds to give Ubuntu enough time to initialize (otherwise, packages may fail to install).'",
"sleep 30"
]
},{
"type": "shell",
"script": "{{template_dir}}/install-rails.sh"
},{
"type": "file",
"source": "{{template_dir}}/../example-rails-app",
"destination": "/home/ubuntu"
},{
"type": "shell",
"inline": [
"cd /home/ubuntu/example-rails-app",
"bundle install"
]
}]
}