-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-ami.json
58 lines (56 loc) · 1.98 KB
/
ubuntu-ami.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
{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"aws_region": "",
"subnet_id": "",
"source_ami": "ami-07ebfd5b3428b6f4d",
"ssh_username": "",
"ami_users": ""
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `aws_region`}}",
"instance_type": "t2.micro",
"subnet_id": "{{user `subnet_id`}}",
"source_ami": "{{user `source_ami`}}",
"ssh_username": "{{user `ssh_username`}}",
"ami_name": "csye6225_{{timestamp}}",
"ami_users": "{{user `ami_users`}}",
"ami_description": "Ubuntu AMI for CSYE 6225 - Spring 2020",
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 8,
"volume_type": "gp2",
"delete_on_termination": true
}
]
}
],
"provisioners": [
{
"type": "shell",
"environment_vars": [
"FOO=foo"
],
"inline": [
"sudo apt-get update",
"sudo apt-get -y install default-jdk",
"sudo apt-get -y install tomcat8",
"sudo apt-get install -y tomcat8-docs tomcat8-examples tomcat8-admin",
"sudo apt-get install -y ruby",
"sudo apt-get install -y wget",
"cd /home/ubuntu",
"wget https://aws-codedeploy-us-east-2.s3.amazonaws.com/latest/install",
"chmod +x ./install",
"sudo ./install auto",
"wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb",
"sudo dpkg -i -E ./amazon-cloudwatch-agent.deb"
]
}
]
}