Conversation
Adds `password_wo` and `password_wo_version` to `hcloud_storage_box` and `hcloud_storage_box_subaccount`, so the password never reaches the Terraform state. `password` becomes optional; exactly one of the two must be set. A write-only value cannot be compared against the state or the API, so the password is only reset when `password_wo_version` is raised — the model the HashiCorp providers use. Closes hetznercloud#1299.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1299
Adds
password_woandpassword_wo_versiontohcloud_storage_boxandhcloud_storage_box_subaccount, so the Storage Box password never reaches the Terraform state.passwordbecomes optional; exactly one ofpasswordandpassword_womust be set (ExactlyOneOf), andpassword_worequirespassword_wo_version.A write-only value is null in plan and state, so it cannot be compared against either. A password reset is therefore triggered by incrementing
password_wo_version— the same model the HashiCorp providers use (e.g.aws_db_instance.password_wo_version). Moving an existing configuration frompasswordtopassword_wodrops the stored password from the state on the next apply.Write-only arguments need Terraform 1.11 / OpenTofu 1.11 or later; the new acceptance tests skip below that, so the OpenTofu 1.10.x job in the matrix is unaffected.
go generateis clean)password_wo, unchanged plan on same version, reset on incremented version,password/password_wonever written to state