-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Dynamic block not reflected in terraform plan when for_each argument is known after apply #34933
Comments
Thanks for filing the issue! If you inspect the full json plan output you should be able to see that the Thanks! |
Hey, this doesn't only seem to be a problem with rendering. We had a dynamic block referencing an resource id via input variable which in turn was referencing the id of a resource. We changed that input to another resource and deleted the previous resource entirely. Terraform tried to delete the resource before changing the id in the dynamic block, what resulted in an error. |
@QBY-ThimoLimpert, that sounds like the expected behavior if the resource was not created with |
Terraform Version
Terraform Configuration Files
Debug Output
https://gist.github.com/QBY-MauriceBaerisch/521ff40682bebb6b43f22244063a2509
Expected Behavior
The creation of the nested dns block should be reflected in the terraform plan.
Actual Behavior
The creation of the nested dns block is not reflected in the terraform plan.
According to the terraform plan, the nested dns block will not be created.
However, if I run
terraform apply
, the nested dns block is indeed processed and the servers are added in Azure.Steps to Reproduce
Using azurerm and the example
where the nested dns block should be dynamically created based on the id of the ip group (which is known after apply), you will see that the dynamic block is not shown in the terraform plan.
terraform init
terraform apply
Additional Context
We try to build nested blocks based on variables known after apply. Unfortunately you cannot use the count field for nested blocks, as described in this issue
An issue for the azurerm provider has already been opened and closed. We believe this is an issue with the terraform core.
References
count
meta-argument #33105The text was updated successfully, but these errors were encountered: