-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tuple vs list problem with output database_route_table_ids during first plan #857
Comments
This issue has been automatically marked as stale because it has been open 30 days |
This issue is still open. |
I have same issue. |
This issue has been automatically marked as stale because it has been open 30 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 |
This issue has been automatically marked as stale because it has been open 30 days |
This issue was automatically closed because of stale in 10 days |
On initial plan the `database_route_table_ids` output is not available due to the values not being known until after apply. Switching the logic to test the length of the array fixes this issue. Credit to @martin566 for discovering the solution. fixes terraform-aws-modules#857
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. |
* fix: ensure database route table output works On initial plan the `database_route_table_ids` output is not available due to the values not being known until after apply. Switching the logic to test the length of the array fixes this issue. Credit to @martin566 for discovering the solution. fixes #857 * Update outputs.tf * Update outputs.tf --------- Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
This issue has been resolved in version 5.1.1 🎉 |
) * fix: ensure database route table output works On initial plan the `database_route_table_ids` output is not available due to the values not being known until after apply. Switching the logic to test the length of the array fixes this issue. Credit to @martin566 for discovering the solution. fixes terraform-aws-modules#857 * Update outputs.tf * Update outputs.tf --------- Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
) * fix: ensure database route table output works On initial plan the `database_route_table_ids` output is not available due to the values not being known until after apply. Switching the logic to test the length of the array fixes this issue. Credit to @martin566 for discovering the solution. fixes terraform-aws-modules#857 * Update outputs.tf * Update outputs.tf --------- Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
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 hashicorp/terraform#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:
The text was updated successfully, but these errors were encountered: