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
provider: automatically generate the *_wo and *_wo_version for write-only arguments + compute: added write-only support for shared_secret argument for google_compute_vpn_tunnel resource (#14933)
Copy file name to clipboardExpand all lines: docs/content/reference/field.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,14 +107,27 @@ Example:
107
107
sensitive: true
108
108
```
109
109
110
+
### `write_only`
111
+
Set to true to enable write-only functionality for this field.
112
+
If true, the [**Write-only Arguments**](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/write-only-arguments) will be automatically generated by the code generator (`[field_name]_wo` and `[field_name]_wo_version`).
113
+
The base field should also be marked as `sensitive` so that the value is obscured in Terraform output but it will still be stored in state. (This is necessary for compatibility with Terraform <v1.11.) The write-only version of the field will be obscured in Terraform output and _won't_ be stored in state. See [Ephemerality in Resources - Use Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral/write-only) for more information.
114
+
115
+
Example:
116
+
117
+
```yaml
118
+
write_only: true
119
+
```
120
+
121
+
**Warning:** This field cannot be used in combination with `exactly_one_of` on multiple write-only fields. This is planned to be [fixed in the future](https://github.com/hashicorp/terraform-provider-google/issues/24327).
122
+
110
123
### `write_only_legacy` (deprecated)
111
124
If true, the field is considered "write-only", which means that its value will
112
125
be obscured in Terraform output as well as not be stored in state. This field is meant to replace `sensitive` as it doesn't store the value in state.
113
126
See [Ephemerality in Resources - Use Write-only arguments](https://developer.hashicorp.com/terraform/language/resources/ephemeral/write-only)
114
127
for more information.
115
128
116
129
Write-only fields are only supported in Terraform v1.11+. Because the provider supports earlier Terraform versions, write only fields must be paired with (mutually exclusive) `sensitive` fields covering the same functionality for compatibility with those older versions.
117
-
This field cannot be used in conjuction with `immutable` or `sensitive`.
130
+
This field cannot be used in conjunction with `immutable` or `sensitive`.
118
131
119
132
**Note**: Due to write-only not being read from the API, it is not possible to update the field directly unless a sidecar field is used. (e.g. `password` as a write-only field and `password_wo_version` as an immutable field meant for updating).
description:=fmt.Sprintf("%s Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)", originalField.Description)
description:=fmt.Sprintf("Triggers update of %s write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)", google.Underscore(writeOnlyField.Name))
log.Fatalf("WriteOnly property '%s' in resource '%s' cannot have RequiredWith set. This combination is not supported.", propWithWoConfigured.Name, r.Name)
0 commit comments