-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
terraform plan
does not account for changes being applied to existing resources which results in a failure
#28436
Comments
Hi @FreyMo, Thanks for filing the issue here. It is up to the provider to mark any planned values which will not be known until apply as "unknown". In this case the provider is planning a null value for The "provider" from Terraform's perspective also includes the behavior of the SDK used by the provider. In this case the behavior seen is a shortcoming of the legacy provider SDK which did not have the ability to handle many situations with complex types, and nested attributes. Since this is a known issue with the legacy SDK, and there is work being done on a next generation SDK already, I'm going to transfer this to the azure provider. They may choose to not work around the issue until #28340 is in place, but the solution does need to come from the provider or SDK in some way. Thanks! |
Hey @jbardin, thank you for the quick reply and the detailed clarification. I really appreciate it. Right now we are kind of stuck between a rock and a hard place because as the end customer, we cannot work around this. Could someone of the azurerm provider team comment on this? Maybe @tombuildsstuff? Thanks in advance |
This issue has been automatically migrated to hashicorp/terraform-provider-azurerm#11374 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-azurerm#11374. |
@jbardin Do you have any idea how does the provider workaround this issue? Seems using |
@magodo, yes, it appears that is also a known issue with the SDK: hashicorp/terraform-plugin-sdk#459. I don't think there is a workaround other than using multiple apply steps to converge. |
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. |
Terraform Version
Terraform Configuration Files
Error Output
Expected Behavior
Adding
SystemAssigned
Managed Identity to an existing resource should update its exportedidentity
attribute to contain one entry. Therefore it should be possible to apply the provided configuration without any problems.azurerm_key_vault_access_policy
relies on the Managed Identity exported from theazurerm_storage_account
.Actual Behavior
Applying was not possible because accessing the exported
identity
attribute failed. As a result theobject_id
of theazurerm_key_vault_acces_policy
can not be set. Output as provided in Error Output is shown.Steps to Reproduce
terraform init && terraform apply
terraform plan
Additional Context
In the References there are two issues linked to the
azurerm
provider that brought me here. It is claimed that this is not a provider problem but rather a problem of Terraform core. It affects multiple resources in theazurerm
provider and is not confined toazurerm_storage_account
. Any addition of aSystemAssigned
Managed Identity to an existing resource will prevent us from using thatidentity
in the same configuration.Possible workarounds
apply
azurerm_key_vault_access_policy
that can now safely accessidentity[0]
References
The text was updated successfully, but these errors were encountered: