Closed QBY-MauriceBaerisch closed 3 months ago
Hi @QBY-MauriceBaerisch,
Thanks for filing the issue! If you inspect the full json plan output you should be able to see that the dns
value is unknown. There does seem to be a bug in the renderer for the CLI output which is not showing that block at all when it's contents are entirely unknown.
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 create_before_destroy
. The standard order of operations would be to delete the old dependency before any updates were applied.
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.
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
33105