-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathami.json
More file actions
61 lines (58 loc) · 2.05 KB
/
ami.json
File metadata and controls
61 lines (58 loc) · 2.05 KB
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
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}",
"aws_region": "{{env `AWS_REGION`}}",
"source_ami": "{{env `SOURCE_AMI`}}",
"ssh_username": "{{env `SSH_USERNAME`}}",
"ami_users": "{{env `AMI_USERS`}}"
},
"sensitive-variables": ["aws_access_key", "aws_secret_key", "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",
"source_ami": "{{user `source_ami`}}",
"ssh_username": "{{user `ssh_username`}}",
"ami_name": "csye6225_{{timestamp}}",
"ami_description": "Ubuntu AMI for CSYE 6225 - Fall 2020",
"ami_users": "{{user `ami_users`}}",
"launch_block_device_mappings": [
{
"device_name": "/dev/sda1",
"volume_size": 8,
"volume_type": "gp2",
"delete_on_termination": true
}
]
}
],
"provisioners": [
{
"type": "shell",
"script": "./setup.sh"
},
{
"type": "shell",
"inline": [
"sudo apt install ruby -y",
"cd /home/ubuntu",
"wget https://aws-codedeploy-{{user `aws_region`}}.s3.{{user `aws_region`}}.amazonaws.com/latest/install",
"chmod +x ./install",
"sudo ./install auto",
"sudo service codedeploy-agent start"
]
},
{
"type": "shell",
"inline": [
"sudo wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb",
"sudo chmod +x ./amazon-cloudwatch-agent.deb",
"sudo dpkg -i -E ./amazon-cloudwatch-agent.deb"
]
}
]
}