You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Similar to #102 , a plan using 7.0.0 of the module results in a for_each invalid argument error. I am using the single account multi-region module.
Terraform version: What Terraform version do you use?
1.7.5
Module version: What module version do you use?
7.0.0
Error message:
│ Error: Invalid for_each argument
│
│ on .terraform/modules/single_account_multi_region/data.tf line 61, in data "aws_route_tables" "this_associated_route_tables":
│ 61: for_each = { for subnet in data.aws_subnets.this.ids : subnet => subnet }
│ ├────────────────
│ │ data.aws_subnets.this.ids is a list of string, known only after apply
│
│ The "for_each" value depends on resource attributes that cannot be
│ determined until apply, so Terraform cannot predict how many instances will
│ be created. To work around this, use the -target argument to first apply
│ only the resources that the for_each depends on.
╵
╷
│ Error: Invalid for_each argument
│
│ on .terraform/modules/single_account_multi_region/data.tf line 94, in data "aws_route_tables" "peer_associated_route_tables":
│ 94: for_each = { for subnet in data.aws_subnets.peer.ids : subnet => subnet }
│ ├────────────────
│ │ data.aws_subnets.peer.ids is a list of string, known only after apply
│
│ The "for_each" value depends on resource attributes that cannot be
│ determined until apply, so Terraform cannot predict how many instances will
│ be created. To work around this, use the -target argument to first apply
│ only the resources that the for_each depends on.
I believe this bug has been introduced by #109 . We are facing the same issue where we try to initiate a new environment. My guess is the VPC and subnets aren't created yet so the values in the for_each can't be determined until apply.
Describe the bug
Similar to #102 , a plan using 7.0.0 of the module results in a for_each invalid argument error. I am using the single account multi-region module.
Terraform version: What Terraform version do you use?
1.7.5
Module version: What module version do you use?
7.0.0
Error message:
Terraform code that produces the error:
Additional context
Workaround is to downgrade to 6.0.0
The text was updated successfully, but these errors were encountered: