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
DOC-1928: Document write-only attributes for Terraform provider (#566)
* DOC-1928: Document write-only attributes for Terraform provider
Adds guidance for the password_wo / password_wo_version pattern shipped
in provider v1.6.0 (PR #303) and updates Schema Registry HCL examples
to use the write-only variants.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add to What's New in Cloud
* Apply suggestions from code review
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
* Apply suggestions from doc review
* Document precedence when both password and password_wo are set
Per gene-redpanda: if both the plaintext attribute and its write-only
counterpart are set on the same resource, the provider uses the
write-only value. Users should avoid setting both.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
Copy file name to clipboardExpand all lines: modules/get-started/pages/whats-new-cloud.adoc
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,10 @@ Remote MCP has been deprecated and removed from Redpanda Cloud.
37
37
38
38
Serverless clusters now support up to 100 Redpanda Connect pipelines and MCP servers. See xref:get-started:cluster-types/serverless.adoc#_serverless_usage_limits[Serverless usage limits].
39
39
40
+
=== Terraform provider: Write-only attributes for sensitive fields
41
+
42
+
The Redpanda Terraform provider (v1.6.0+) now supports https://developer.hashicorp.com/terraform/plugin/framework/resources/write-only-arguments[Terraform 1.11+ write-only attributes^] for sensitive fields such as user passwords and pipeline client secrets. Use the new `password_wo` and `password_wo_version` attributes (and equivalents for other sensitive fields) to keep credentials out of your `.tfstate` file. See xref:manage:terraform-provider.adoc#manage-sensitive-attributes-with-write-only-fields[Manage sensitive attributes with write-only fields].
43
+
40
44
=== Redpanda Connect updates
41
45
42
46
* The Redpanda Connect pipeline creation and editing workflow has been simplified. The new UI replaces the previous multi-page wizard with a visual pipeline diagram, an IDE-like configuration editor, slash commands for inserting variables, and inline links to component documentation. See the xref:develop:connect/connect-quickstart.adoc[Redpanda Connect quickstart] to try it out.
== Manage sensitive attributes with write-only fields
203
+
204
+
You can use https://developer.hashicorp.com/terraform/plugin/framework/resources/write-only-arguments[Terraform 1.11+ write-only attributes^] to keep sensitive values out of your Terraform state file. By default, Terraform persists sensitive attributes such as passwords to `.tfstate` when you run `terraform apply`. When you store state in a remote backend or in CI runner artifacts, this can leak credentials.
205
+
206
+
[IMPORTANT]
207
+
====
208
+
Write-only attributes require Terraform CLI 1.11 or later and Redpanda Terraform provider v1.6.0 or later.
209
+
====
210
+
211
+
=== How write-only attributes work
212
+
213
+
For each supported sensitive field, the provider exposes two new attributes alongside the existing one:
214
+
215
+
* `<field>_wo`: A write-only attribute. Terraform sends the value to the provider during `apply` but never persists it to state.
216
+
* `<field>_wo_version`: An integer version. Because Terraform cannot detect changes in a write-only value (there is nothing to compare against in state), you increment this number to signal that the value has changed and to trigger an update on the next apply.
217
+
218
+
NOTE: `redpanda_pipeline` is an exception to this naming convention. The existing `client_secret` attribute is the write-only attribute (no separate `client_secret_wo` field), and is paired with `secret_version` instead of `client_secret_wo_version`.
219
+
220
+
The provider retains the original plaintext attributes for backward compatibility. You can migrate to the write-only variants on your own schedule. Avoid setting both the plaintext attribute and its write-only counterpart on the same resource. If both are set, the provider uses the write-only value.
Inject the sensitive value through a sensitive Terraform variable, an environment variable, or your secrets manager. The following example uses a `TF_VAR_` environment variable to populate `var.schema_password`:
251
+
252
+
[source,hcl]
253
+
----
254
+
variable "schema_password" {
255
+
description = "Password for the Schema Registry user"
After running `terraform apply`, the provider sends the new password to Redpanda Cloud. Neither the old nor the new value is written to state.
296
+
202
297
== Examples
203
298
204
299
This section provides examples of using the Redpanda Terraform provider to create and manage clusters. For descriptions of resources and data sources, see the https://registry.terraform.io/providers/redpanda-data/redpanda/latest/docs[Redpanda Terraform Provider documentation^].
@@ -486,11 +581,12 @@ data "redpanda_cluster" "byoc" {
* `subject` defines the logical name under which schema versions are registered.
520
617
* `schema_type` specifies the serialization type (`AVRO`, `JSON`, or `PROTOBUF`).
521
618
* `schema` provides the full schema definition, encoded with `jsonencode()`.
522
-
* `username` and `password` authenticate the user to the Schema Registry.
619
+
* `username` identifies the Schema Registry user. Set `password_wo` to the password value, and increment `password_wo_version` to trigger updates. For details, see <<manage-sensitive-attributes-with-write-only-fields>>.
523
620
524
621
==== Store credentials securely
525
622
526
-
Store credentials using environment variables or sensitive Terraform variables.
623
+
Use Terraform 1.11+ write-only attributes (such as `password_wo`) to keep Schema Registry credentials out of your `.tfstate` file. For details, see <<manage-sensitive-attributes-with-write-only-fields>>.
527
624
528
-
For short-lived credentials or CI/CD usage, use provider-level environment variables:
625
+
For short-lived credentials or CI/CD usage, you can also export the Schema Registry credentials as provider-level environment variables. The provider reads them automatically:
Or, declare a sensitive Terraform variable and inject it at runtime:
633
+
If you must use the deprecated plaintext `password` attribute (for example, on Terraform versions earlier than 1.11), declare a sensitive Terraform variable and inject the value at runtime to avoid committing secrets to source control:
The `redpanda_schema_registry_acl` resource configures fine-grained access control for Schema Registry subjects or registry-wide operations. Each ACL specifies which principal can perform specific operations on a subject or the registry.
operation = "READ" # READ, WRITE, DELETE, DESCRIBE, etc.
569
662
permission = "ALLOW" # ALLOW or DENY
570
-
username = redpanda_user.schema_user.name
571
-
password = var.schema_password
663
+
username = redpanda_user.schema_user.name
664
+
password_wo = var.schema_password
665
+
password_wo_version = 1
572
666
}
573
667
----
574
668
@@ -582,7 +676,7 @@ In this example:
582
676
* `operation` defines the permitted action (`READ`, `WRITE`, `DELETE`, etc.).
583
677
* `permission` defines whether the operation is allowed or denied.
584
678
* `host` specifies the host filter (typically `"*"` for all hosts).
585
-
* `username` and `password` authenticate the principal to the Schema Registry.
679
+
* `username` identifies the Schema Registry principal. Set `password_wo` to the password value, and increment `password_wo_version` to trigger updates. For details, see <<manage-sensitive-attributes-with-write-only-fields>>.
586
680
587
681
TIP: To manage Schema Registry ACLs, the user must have cluster-level `ALTER` permissions. This is typically granted through a Kafka ACL with `ALTER` on the `CLUSTER` resource.
588
682
@@ -597,11 +691,12 @@ data "redpanda_cluster" "byoc" {
0 commit comments