-
Notifications
You must be signed in to change notification settings - Fork 233
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
Is it possible to have a dependency between 2 attributes? #1267
Comments
Hi @orgads 👋 Thank you for raising this. Yes, it is possible to do this in terraform-plugin-sdk based provider code (and terraform-plugin-framework based provider code when the provider is migrated). The For example, the terraform-provider-aws If the attribute value after update is known upfront, then a custom Hope this helps. Please note that general provider development questions should either be asked in the provider issue tracker so those provider maintainers can offer a tailored answer for their particular provider coding patterns or on HashiCorp Discuss where there are many more developers to answer. This issue tracker here is used for bug reports and feature requests with the terraform-plugin-sdk Go module. Thanks! |
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. |
SDK version
Regarding hashicorp/terraform-provider-azurerm#13337 about azurerm_key_vault_secret.
When
value
is changed, this results in changes also toversion
and toid
, but these changes are not detected until apply.Is it possible to have a dependency to informs tf that if
value
is changed this will result in other fields changing in the target state (known after apply)? Notice that this does not create a new resource (the operation doesn't delete the previous secret and create a new one), it just creates a new version on the existing secret, which is reflected in its id.Terraform Configuration Files
Expected Behavior
Changing the value should detect that
version
andid
will change on apply, and consider them as "known after apply".Actual Behavior
They're considered unchanged in the plan, and on apply they have unexpected values. This leads to inconsistent plan on dependent resources that use the id, or at least a need to apply twice.
Steps to Reproduce
terraform init
terraform apply
terraform apply
References
The text was updated successfully, but these errors were encountered: