You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/plugin/framework/handling-data/attributes/set-nested.mdx
-14Lines changed: 0 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,20 +159,6 @@ The [`setplanmodifier`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin
159
159
160
160
Set the `Sensitive` field if the attribute value should always be considered [sensitive data](/terraform/language/state/sensitive-data). In Terraform, this will generally mask the value in practitioner output. This setting cannot be conditionally set and does not impact how data is stored in the state.
161
161
162
-
### WriteOnly
163
-
164
-
<Highlight>
165
-
166
-
Only managed resources implement this concept.
167
-
168
-
</Highlight>
169
-
170
-
Set the `WriteOnly` field to define a [write-only argument](/terraform/plugin/framework/resources/write-only-arguments).
171
-
Write-only arguments can accept [ephemeral values](/terraform/language/resources/ephemeral)
172
-
and are not persisted in the Terraform plan or state artifacts. Write-only arguments are supported in Terraform 1.11 and later.
173
-
174
-
If a nested attribute has the `WriteOnly` field set, all child attributes must also have `WriteOnly` set.
175
-
176
162
### Validation
177
163
178
164
Set the `Validators` field to define [validation](/terraform/plugin/framework/validation#attribute-validation). This validation logic is ran in addition to any validation contained within a [custom type](#custom-types).
Copy file name to clipboardExpand all lines: website/docs/plugin/framework/handling-data/attributes/set.mdx
-12Lines changed: 0 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,18 +128,6 @@ The [`setplanmodifier`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin
128
128
129
129
Set the `Sensitive` field if the attribute value should always be considered [sensitive data](/terraform/language/state/sensitive-data). In Terraform, this will generally mask the value in practitioner output. This setting cannot be conditionally set and does not impact how data is stored in the state.
130
130
131
-
### WriteOnly
132
-
133
-
<Highlight>
134
-
135
-
Only managed resources implement this concept.
136
-
137
-
</Highlight>
138
-
139
-
Set the `WriteOnly` field to define a [write-only argument](/terraform/plugin/framework/resources/write-only-arguments).
140
-
Write-only arguments can accept [ephemeral values](/terraform/language/resources/ephemeral)
141
-
and are not persisted in the Terraform plan or state artifacts. Write-only arguments are supported in Terraform 1.11 and later.
142
-
143
131
### Validation
144
132
145
133
Set the `Validators` field to define [validation](/terraform/plugin/framework/validation#attribute-validation). This validation logic is ran in addition to any validation contained within a [custom type](#custom-types).
Copy file name to clipboardExpand all lines: website/docs/plugin/framework/resources/write-only-arguments.mdx
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,9 @@ which should either use the value by making the appropriate change to the API or
15
15
16
16
The following are high level differences between `Required`/`Optional` arguments and write-only arguments:
17
17
18
-
- Write-only arguments can accept ephemeral and non-ephemeral values
18
+
- Write-only arguments can accept ephemeral and non-ephemeral values.
19
+
20
+
- Write-only arguments cannot be used with set attributes, set nested attributes, and set nested blocks.
19
21
20
22
- Write-only argument values are only available in the configuration. The prior state, planned state, and final state values for
21
23
write-only arguments should always be `null`.
@@ -25,15 +27,15 @@ write-only arguments should always be `null`.
25
27
26
28
- Write-only argument values cannot produce a Terraform plan difference.
27
29
- This is because the prior state value for a write-only argument will always be `null` and the planned/final state value will also be `null`, therefore, it cannot produce a diff on its own.
28
-
- The one exception to this case is if the write-only argument is added to `requires_replace` during Plan Modification (i.e., using the [`RequiresReplace()`](/terraform/plugin/framework/resources/plan-modification#requiresreplace) plan modifier), in that case, the write-only argument will always cause a diff/trigger a resource recreation
30
+
- The one exception to this case is if the write-only argument is added to `requires_replace` during Plan Modification (i.e., using the [`RequiresReplace()`](/terraform/plugin/framework/resources/plan-modification#requiresreplace) plan modifier), in that case, the write-only argument will always cause a diff/trigger a resource recreation.
29
31
30
32
- Since write-only arguments can accept ephemeral values, write-only argument configuration values are not expected to be consistent between plan and apply.
31
33
32
34
## Schema
33
35
34
36
An attribute can be made write-only by setting the `WriteOnly` field to `true` in the schema. Attributes with `WriteOnly` set to `true` must also have
35
-
one of `Required` or `Optional` set to `true`. If a nested attribute has `WriteOnly` set to `true`, all child attributes must also have `WriteOnly` set to `true`.
36
-
`Computed` cannot be set to true for write-only arguments.
37
+
one of `Required` or `Optional` set to `true`. If a list nested, map nested, or single nested attribute has `WriteOnly` set to `true`, all child attributes must also have `WriteOnly` set to `true`.
38
+
A set nested block cannot have any child attributes with `WriteOnly` set to `true`. `Computed` cannot be set to true for write-only arguments.
0 commit comments