f5devcentral / terraform-aws-bigip

BIG-IP AWS module for the Terraform Registry
MIT License
10 stars 25 forks source link

1-nic examples deployment failing #39

Closed codygreen closed 4 years ago

codygreen commented 4 years ago

Error: Invalid index

on ../../main.tf line 75, in resource "aws_instance" "f5_bigip": 75: for_each = toset([aws_network_interface.mgmt[count.index].id]) |---------------- | aws_network_interface.mgmt is empty tuple | count.index is 1

The given key does not identify an element in this collection value.

Error: Invalid index

on ../../main.tf line 75, in resource "aws_instance" "f5_bigip": 75: for_each = toset([aws_network_interface.mgmt[count.index].id]) |---------------- | aws_network_interface.mgmt is empty tuple | count.index is 0

The given key does not identify an element in this collection value.

codygreen commented 4 years ago

I've examined the error but I cannot pinpoint what is failing. The vpc module is creating two public subnets. Also, 2-nic and 3-nic examples are not experiencing this error but they use the same public subnets created by the vpc module.

Also, 0.12 removed the terraform output --module option... so I'll have to find another way to view the module output versus the module state.

javedw commented 4 years ago

Hey Cody, I am getting the same error as below, not sure what's missing:

Error: Invalid index

on main.tf line 76, in resource "aws_instance" "f5_bigip": 76: for_each = toset([aws_network_interface.mgmt[count.index].id]) |---------------- | aws_network_interface.mgmt is empty tuple | count.index is 0

The given key does not identify an element in this collection value.

mjmenger commented 4 years ago

@javedw Can you include the reference you're using to invoke the module?

Hey Cody, I am getting the same error as below, not sure what's missing:

Error: Invalid index

on main.tf line 76, in resource "aws_instance" "f5_bigip": 76: for_each = toset([aws_network_interface.mgmt[count.index].id]) |---------------- | aws_network_interface.mgmt is empty tuple | count.index is 0

The given key does not identify an element in this collection value.