Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
semnil committed Aug 20, 2024
1 parent 80e7909 commit 1a039c8
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion example/count/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ provider "aws" {
}

resource "aws_elb" "web" {
name = "terraform-example-elb"
name = "terraform-example-elb-web"

# The same availability zone as our instances
availability_zones = ["${aws_instance.web.*.availability_zone}"]
Expand All @@ -27,3 +27,28 @@ resource "aws_instance" "web" {
# This will create 4 instances
count = 4
}

resource "aws_elb" "api" {
name = "terraform-example-elb-api"

# The same availability zone as our instances
availability_zones = ["${aws_instance.api.*.availability_zone}"]

listener {
instance_port = 80
instance_protocol = "http"
lb_port = 80
lb_protocol = "http"
}

# The instances are registered automatically
instances = ["${aws_instance.api.*.id}"]
}

resource "aws_instance" "api" {
instance_type = "m1.small"
ami = "${lookup(var.aws_amis, var.aws_region)}"

# This will create 4 instances
count = 4
}

0 comments on commit 1a039c8

Please sign in to comment.