-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for write only attributes (#1044)
* initial ephemeral resource interfaces * add ephemeral resource configure data * attribute implementations * uncomment custom type tests * added block implementations * add nested attribute implementations * add schema test * remove todo * doc updates, renames, removals * initial protov5 + fwserver implementation (protov6 stubbed) * add fromproto5 tests * add toproto5 tests * add proto5server tests * implement protov6 * schema + metadata tests * add close proto5/6 tests * add fwserver tests for schema/metadata * prevent random false positives * validate fwserver tests * open/renew/close fwserver tests * update error message * update plugin go * Update `terraform-plugin-go` dependency * remove `config` from renew * Implement write only attributes in the `resource/schema` package * Implement write only attributes in the `datasource/schema` package * Implement write only attributes in the `provider/schema` and `provider/metaschema` packages * Implement write only attributes in the `internal/testing/testschema` package * Update `terraform-plugin-go` dependency * Implement write only attributes in the `ephemeral/schema` package * Populate writeOnly fields in `internal/toproto5` and `internal/toproto6` * Implement `ValidateResourceConfigClientCapabilities` in the `ValidateResourceConfig` RPC * Add attribute validation for write only attributes * Initial `RequiredWriteOnlyNilsAttributePaths()` implementation * Complete `RequiredWriteOnlyNilsAttributePaths()` implementation * Implement `validator.ValidateSchemaClientCapabilities` * Implement automatic write-only value nullification during `ApplyResourceState` RPC * Explicitly set `ValidateSchemaClientCapabilities` during `ValidateDataSourceConfig`, `ValidateEphemeralResourceConfig`, and `ValidateProviderResourceConfig` RPCs * Nullify write-only attributes during Plan and Apply regardless of client capability * remove apply client capability * add validation for older terraform client versions * add client capabilities to nested attribute validation * Update wording of `IsWriteOnly` comment for `ephemeral/schema`, `provider/schema`, and `provider/metaschema` * Update various comments for wording * Update test cases * Update wording for `write-only` attribute validation errors * Refactor write_only_nested_attribute_validation.go and write_only_nested_attribute_validation_test.go * Move `Required` + `WriteOnly` validations from `PlanResourceChange` RPC to `ValidateResourceConfig` RPC * Add write-only value nullification to `ReadResource`, `ImportResourceState`, `UpgradeResourceState`, and `MoveResourceState` RPCs * Add missing `IsWriteOnly()` unit tests for `ephemeral/schema` package * Add godoc comment to `NullifyWriteOnlyAttributes()` * Add testing for nested types for `NullifyWriteOnlyAttributes()` * Add website documentation * Add recommendation to use private state to store hashes * Add changelog entries --------- Co-authored-by: Austin Valle <[email protected]>
- Loading branch information
1 parent
3c0bf49
commit e1e6866
Showing
277 changed files
with
9,882 additions
and
204 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: FEATURES | ||
body: 'resource/schema: Added `WriteOnly` schema field for managed resource schemas to indicate a write-only attribute. | ||
Write-only attribute values are not saved to the Terraform plan or state artifacts.' | ||
time: 2025-02-06T11:47:00.176842-05:00 | ||
custom: | ||
Issue: "1044" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
kind: NOTES | ||
body: Write-only attribute support is in technical preview and offered without compatibility promises until Terraform 1.11 is generally available. | ||
time: 2025-02-06T11:44:36.156747-05:00 | ||
custom: | ||
Issue: "1044" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.