ACR Token resource causing planning issues after recreation of the container registry #27215
Closed
1 task done
Labels
Milestone
Is there an existing issue for this?
Community Note
Terraform Version
1.8.2
AzureRM Provider Version
3.116.0
Affected Resource(s)/Data Source(s)
azurerm_container_registry_token, azurerm_container_registry_scope_map
Terraform Configuration Files
Debug Output/Panic Output
https://gist.github.com/HontoNoRoger/5913efb4a2d213b9d2d218a3ae0af30a
Expected Behaviour
During the recreation of the Container Registry, the resources
azurerm_container_registry_scope_map
,azurerm_container_registry_token
andazurerm_container_registry_token_password
should have been planned to be recreated.Actual Behaviour
The recreation of the Container Registry happened without also flagging the resources
azurerm_container_registry_scope_map
,azurerm_container_registry_token
andazurerm_container_registry_token_password
to be recreated.After the recreation of the Container Registry has been done successfully, subsequent plans fail as the
azurerm_container_registry_token
cannot be found anymore, as it was silently deleted together with the Container Registry.A workaround that helped me to get over this is to use a lifecycle block like the following to force recreation of the resources in question together with the recreation of the Container Registry:
Steps to Reproduce
terraform apply
for the first rolloutterraform taint azurerm_container_registry.container_registry
simulating a recreation of the Container Registry, e.g. due to changes to some fields that requires recreationterraform apply
for the recreation of the Container Registryterraform plan
orterraform apply
for seeing the errorImportant Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: