-
Notifications
You must be signed in to change notification settings - Fork 239
all: Add support for write-only attributes #1375
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
Merged
Merged
Changes from 60 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
6e8402b
Update `terraform-plugin-go` dependency
SBGoods d30854f
Add `WriteOnly` attribute to schema and internal schema validation.
SBGoods 17b4a61
Add `WriteOnly` validation for data source, provider, and provider me…
SBGoods 5218321
Add WriteOnly capabilities validation to `ValidateResourceTypeConfig`…
SBGoods bb2bb08
Skip value validation for `Required` + `WriteOnly` attributes.
SBGoods 1d70831
Fix intermittent test failures for `hasWriteOnly()`
SBGoods e7d79db
Validate non-null values for `Required` and `WriteOnly` attributes in…
SBGoods d171fb7
Add initial implementation for `PreferWriteOnlyAttribute()` validator
SBGoods 25c2a13
Finish `PreferWriteOnlyAttribute()` validator implementation.
SBGoods 2f917f8
Move `schema.ValidateResourceConfigFuncs` to `schema.Resource` and im…
SBGoods cab2a27
Add automatic state handling for writeOnly attributes
SBGoods 6cc6811
Apply suggestions from code review
SBGoods 994bc66
Wrap `setWriteOnlyNullValues` call in client capabilities check
SBGoods ff70638
Refactor tests to match diag summary changes
SBGoods c5c870d
Move write-only helper functions and tests to their own files.
SBGoods 21cebbe
Refactor test attribute names for clarity
SBGoods a276ff4
Refactor `validateWriteOnlyNullValues()` to build an attribute path.`
SBGoods fac41b5
Refactor `validateWriteOnlyRequiredValues()` to build an attribute pa…
SBGoods 7cf9024
Refactor field and function names based on PR feedback.
SBGoods d3a4926
Add clarifying comments.
SBGoods 437577d
Add internal validation preventing data sources from defining `Valida…
SBGoods d5a7bd6
Change `writeOnlyAttributeName` parameter to use `cty.Path`
SBGoods 5c2e2e2
Simplify validation condition logic
SBGoods 1c21c96
Merge branch 'main' into SBGoods/write-only-attributes
SBGoods a5d8c2a
run `go mod tidy`
SBGoods 3f32220
update `terraform-plugin-go` dependency
SBGoods 28a5768
Add write-only support to `ProtoToConfigSchema()`
SBGoods 2aec830
Nullify write-only attributes during Plan and Apply regardless of cli…
SBGoods 1479d62
Introduce `(*ResourceData).GetRawWriteOnly()` and `(*ResourceData).Ge…
SBGoods 18894a8
Revert "Introduce `(*ResourceData).GetRawWriteOnly()` and `(*Resource…
SBGoods 20550b9
Introduce `(*ResourceData).GetRawConfigAt()` helper method for retrie…
SBGoods 396b49b
null out write-only values
austinvalle e1dbbac
Return `diag.Diagnostics` instead of error for `(*ResourceData).GetRa…
SBGoods 84b9873
Update `terraform-plugin-go` dependency
SBGoods 0a9d11a
Add additional tests for automatic write-only value nullification
SBGoods 6461314
Resolve linting errors and add copyright headers
SBGoods 45cceb5
Merge branch 'main' into SBGoods/write-only-attributes
SBGoods 0816d60
Remove "incorrect" test case
SBGoods e844e2d
Use `cty.DynamicVal` as default value for `GetRawConfigAt()`
SBGoods ec6675f
Throw validation error for computed blocks with write-only attributes
SBGoods f529da0
add `GetRawConfigAt` to `ResourceDiff` for usage in `CustomizeDiff` f…
austinvalle 5f29273
unit tests for `ResourceDiff`
austinvalle c0d2bac
Add validation error for `WriteOnly` and `ForceNew`
SBGoods 1dcc224
Add write-only value nullification to `ImportResourceState` and `Upgr…
SBGoods f831b07
Move `Required` + `WriteOnly` attribute validation to `ValidateResour…
SBGoods 48b23cd
Merge remote-tracking branch 'origin/SBGoods/write-only-attributes' i…
SBGoods 3e85928
Merge branch 'main' into SBGoods/write-only-attributes
SBGoods 511005e
Add website documentation
SBGoods b6c06cf
Add changelog entries
SBGoods 36978c5
Update `terraform-plugin-go` dependency to `v0.24.0`
SBGoods 33b7ee4
Replace fully qualified links with relative links in website document…
SBGoods d1d4c14
Add more test cases for `GetRawConfigAt()`
SBGoods 1b935c4
Add link to ephemeral resource documentation
SBGoods 5070aeb
Apply suggestions from code review
SBGoods 4b5b363
Apply suggestions from code review
SBGoods c1a1556
Fix write-only attribute error assertions
SBGoods d40b6b0
Prevent `WriteOnly` from being used with `Default` and `DefaultFunc`.
SBGoods 6d9ab94
Update error messaging
SBGoods 91bc003
Add null value test case
SBGoods 2c0793b
Rename "write-only attributes" to "write-only arguments" in website d…
SBGoods 099130f
Add configuration examples to `cty.Path` documentation
SBGoods 74dccee
Merge branch 'main' into SBGoods/write-only-attributes
SBGoods e58d5e3
Add changelog entry for `ValidateRawResourceConfigFuncs`
SBGoods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: FEATURES | ||
| body: 'helper/schema: Added `WriteOnly` schema behavior 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-01-21T16:56:44.038893-05:00 | ||
| custom: | ||
| Issue: "1375" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| kind: FEATURES | ||
| body: 'helper/validation: Added `PreferWriteOnlyAttribute()` validator that warns practitioners when a write-only version of | ||
| a configured attribute is available.' | ||
| time: 2025-01-21T17:01:05.40229-05:00 | ||
| custom: | ||
| Issue: "1375" |
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
| 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-01-21T17:05:45.398836-05:00 | ||
| custom: | ||
| Issue: "1375" |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.