Skip to content

Commit 520ff01

Browse files
committed
master and agents .tf files need to use element in subnet_id
1 parent 3724d5e commit 520ff01

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

aws/master.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ resource "aws_instance" "master" {
161161
# We're going to launch into the same subnet as our ELB. In a production
162162
# environment it's more common to have a separate private subnet for
163163
# backend instances.
164-
subnet_id = "${aws_subnet.public.*.id[count.index]}"
164+
subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
165165

166166
# We run a remote provisioner on the instance after creating it.
167167
# In this case, we just install nginx and start it. By default,

aws/private-agent.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ resource "aws_instance" "agent" {
4242
# We're going to launch into the same subnet as our ELB. In a production
4343
# environment it's more common to have a separate private subnet for
4444
# backend instances.
45-
subnet_id = "${aws_subnet.private.*.id[count.index]}"
45+
subnet_id = "${element(aws_subnet.private.*.id, count.index)}"
4646

4747
# OS init script
4848
provisioner "file" {

aws/public-agent.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ resource "aws_instance" "public-agent" {
8484
# We're going to launch into the same subnet as our ELB. In a production
8585
# environment it's more common to have a separate private subnet for
8686
# backend instances.
87-
subnet_id = "${aws_subnet.public.*.id[count.index]}"
87+
subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
8888

8989
# OS init script
9090
provisioner "file" {

0 commit comments

Comments
 (0)