-
Notifications
You must be signed in to change notification settings - Fork 113
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
Consul Provider token rotation issue #298
Comments
Hi @askmike1, thanks for opening this issue. Sadly the issue here lies in how Terraform interact with providers, when reading a resource the provider only gets the current state as input, not the current user-configuration: https://github.com/hashicorp/terraform/blob/e6dbb7faf0407f6f98a451bbe8b0eb5fc160b4ec/docs/plugin-protocol/tfplugin6.2.proto#L249-L254. The The best way forward is to use the I will probably mark the |
Having the token attribute in the resources causes issues: when a user updates it the previous value is used when calling the `Read()` method. This is expected based on the protocol Terraform Core uses and there is no way to have the correct behavior here. To fix this I mark the "token" attribute as deprecated so that users only set the one in the "provider" block. I also mark all "datacenter", "namespace" and "partition" attribute as ForceNew to avoid the same issue with those. Closes hashicorp#298
Having the token attribute in the resources causes issues: when a user updates it the previous value is used when calling the `Read()` method. This is expected based on the protocol Terraform Core uses and there is no way to have the correct behavior here. To fix this I mark the "token" attribute as deprecated so that users only set the one in the "provider" block. I also mark all "datacenter", "namespace" and "partition" attribute as ForceNew to avoid the same issue with those. Closes #298
Terraform Version
Tested with 0.12.31 & 1.1.7
Affected Resource(s)
Terraform Configuration Files
Debug Output
N/A
Panic Output
N/A
Expected Behavior
When token changes it should pick up the new one
Actual Behavior
It tries to use whatever token is in the state file and thus fails as it no longer exists
Steps to Reproduce
terraform init
terraform plan
terraform apply
terraform plan
Output:
Important Factoids
N/A
References
N/A
The text was updated successfully, but these errors were encountered: