· 6 years ago · Jun 27, 2019, 12:34 AM
1{
2 "variables": {
3 "aws_access_key": "",
4 "aws_secret_key": "",
5 "aws_region": "",
6 "subnet_id": "",
7 "source_ami": "ami-0a313d6098716f372",
8 "ssh_username":"ubuntu"
9 },
10 "builders": [
11 {
12 "type": "amazon-ebs",
13 "access_key": "{{user `aws_access_key`}}",
14 "secret_key": "{{user `aws_secret_key`}}",
15 "region": "{{user `aws_region`}}",
16 "instance_type": "t2.micro",
17 "subnet_id": "{{user `subnet_id`}}",
18 "source_ami": "{{user `source_ami`}}",
19 "ssh_username": "{{user `ssh_username`}}",
20 "ami_name": "csye6225_{{timestamp}}",
21 "ami_description": "Ubuntu AMI for CSYE 6225 - Spring 2019",
22 "launch_block_device_mappings": [
23 {
24 "device_name": "/dev/sda1",
25 "volume_size": 8,
26 "volume_type": "gp2",
27 "delete_on_termination": true
28 }
29 ]
30 }
31 ],
32 "provisioners": [
33 {
34 "type": "shell",
35 "environment_vars": [
36 "FOO=foo"
37 ],
38 "inline": [
39 "sudo apt-get update",
40 "sudo apt-get install apache2 apache2-doc apache2-utils -y"
41 ]
42 }
43 ]
44}