| 1 |
{ |
| 2 |
"output": { |
| 3 |
"address": { |
| 4 |
"value": "${aws_elb.web.dns_name}" |
| 5 |
} |
| 6 |
}, |
| 7 |
"provider": { |
| 8 |
"aws": { |
| 9 |
"access_key": "XXX", |
| 10 |
"region": "us-east-1", |
| 11 |
"secret_key": "YYY" |
| 12 |
} |
| 13 |
}, |
| 14 |
"resource": { |
| 15 |
"aws_elb": { |
| 16 |
"web": { |
| 17 |
"availability_zones": [ |
| 18 |
"${aws_instance.web.availability_zone}" |
| 19 |
], |
| 20 |
"instances": [ |
| 21 |
"${aws_instance.web.id}" |
| 22 |
], |
| 23 |
"listener": { |
| 24 |
"instance_port": 80, |
| 25 |
"instance_protocol": "http", |
| 26 |
"lb_port": 80, |
| 27 |
"lb_protocol": "http" |
| 28 |
}, |
| 29 |
"name": "terraform-example-elb" |
| 30 |
} |
| 31 |
}, |
| 32 |
"aws_instance": { |
| 33 |
"web": { |
| 34 |
"ami": "ami-de7ab6b6", |
| 35 |
"connection": { |
| 36 |
"key_file": "key_path", |
| 37 |
"user": "ubuntu" |
| 38 |
}, |
| 39 |
"instance_type": "m1.small", |
| 40 |
"key_name": "key_name", |
| 41 |
"provisioner": { |
| 42 |
"remote-exec": { |
| 43 |
"inline": [ |
| 44 |
"sudo apt-get -y update", |
| 45 |
"sudo apt-get -y install nginx", |
| 46 |
"sudo service nginx start" |
| 47 |
] |
| 48 |
} |
| 49 |
}, |
| 50 |
"security_groups": [ |
| 51 |
"terraform_example" |
| 52 |
] |
| 53 |
} |
| 54 |
}, |
| 55 |
"aws_security_group": { |
| 56 |
"default": { |
| 57 |
"description": "Used in the terraform", |
| 58 |
"ingress": [ |
| 59 |
{ |
| 60 |
"cidr_blocks": [ |
| 61 |
"0.0.0.0/0" |
| 62 |
], |
| 63 |
"from_port": 22, |
| 64 |
"protocol": "tcp", |
| 65 |
"to_port": 22 |
| 66 |
}, |
| 67 |
{ |
| 68 |
"cidr_blocks": [ |
| 69 |
"0.0.0.0/0" |
| 70 |
], |
| 71 |
"from_port": 80, |
| 72 |
"protocol": "tcp", |
| 73 |
"to_port": 80 |
| 74 |
} |
| 75 |
], |
| 76 |
"name": "terraform_example" |
| 77 |
} |
| 78 |
} |
| 79 |
} |
| 80 |
} |