Closed martin566 closed 1 year ago
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue is still open.
I have same issue. When this issue fix release?
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
I am afraid this is a core Terraform issue, that is coming from here
for_each = {
for route in local.routes_to_transit_gateway_per_table : route.route_entry_name => route
}
You cannot use for_each
over a map where the key is unknown; Hashi recommends using a static value and not a computed value as the key for this reason https://github.com/hashicorp/terraform/issues/30937
This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days
This issue was automatically closed because of stale in 10 days
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
This issue has been resolved in version 5.1.1 :tada:
Description
Usage of output database_route_table_ids in another module causes error "Invalid for_each argument" during first plan/apply.
Cause seems to be that the output delivers a tuple during first plan/apply, because the route_table is still not existing, but a list after the first apply. This seems to be related to https://github.com/hashicorp/terraform/issues/31102, but the usage of tolist() function, did not help in the exampe below.
Versions
Reproduction Code [Required]
Steps to reproduce the behavior:
terraform init & terraform plan
Expected behavior
terraform plan shows, that the following resource will be created
Actual behavior
terraform plan shows the following error message:
Solution
Can be solved by the following change: