forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
29 lines (23 loc) · 666 Bytes
/
Copy pathmain.tf
File metadata and controls
29 lines (23 loc) · 666 Bytes
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
# Specify the provider and access details
provider "aws" {
region = "${var.aws_region}"
}
resource "aws_elb" "web" {
name = "terraform-example-elb"
# The same availability zone as our instances
availability_zones = ["${aws_instance.web.*.availability_zone}"]
listener {
instance_port = 80
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}
# The instances are registered automatically
instances = ["${aws_instance.web.*.id}"]
}
resource "aws_instance" "web" {
instance_type = "m1.small"
ami = "${lookup(var.aws_amis, var.aws_region)}"
# This will create 4 instances
count = 4
}