Skip to content

Commit 2581b25

Browse files
mfernestclaudeFeediver1
authored
fix(DOC-1958): add lifecycle ignore_changes guidance and prose cleanup (#533)
* fix(DOC-1958): add lifecycle ignore_changes guidance and prose cleanup - Add lifecycle block example for throughput_tier to prevent accidental cluster replacement when Redpanda Support upgrades a cluster - Rewrite opening sentence to remove weak verbs - Cut throat-clearing prose throughout (234 net word reduction) - Fix passive voice, future tense, e.g./etc., and Title Case violations - Tighten callout <1> from 9 sentences to 3 - Replace placeholder "your-secret-password" with "schema-registry-password" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Address review feedback: fix deletion-order NOTE and align source-block language tag - Correct the dependency deletion-order example in the 'Delete resources' NOTE (line 757). Terraform destroys the *dependent* resource (cluster) before its *dependency* (network), not after. CodeRabbit flagged this on 2026-03-19; the original prose had the same bug and the prose cleanup in this PR preserved it. - Change the new lifecycle code block's language tag from '[source,terraform]' to '[source,hcl]' so it matches the convention used by every other code block in this file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address additional review feedback: restore lost information and tighten WARNING wording Three findings from a follow-up review pass: 1. 'Manage an existing cluster' — restore the cluster_api_url explanation. The previous rewrite dropped the sentence that explains the cluster_api_url attribute on the data source, which is the actual mechanism the code block below depends on. Without that explanation, readers have to reverse-engineer the data-resource role from the HCL. 2. 'Create a schema' and 'Manage Schema Registry ACLs' — restore the explicit resource-name mentions (redpanda_schema and redpanda_schema_registry_acl). Section intros are where readers scan for 'what resource do I use to do X?'; the rewrite removed those anchors. Reinstated as opening sentences. 3. Limitations WARNING — change 'allows' to 'causes' in the throughput_tier warning. 'Allows Terraform to destroy' reads as conditional/optional; the actual semantics are unconditional ('the next apply triggers replacement'). 'Causes Terraform to destroy and replace' carries the right urgency for a destructive-operation WARNING. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com> Co-authored-by: Joyce Fee <joyce@redpanda.com>
1 parent 728110b commit 2581b25

1 file changed

Lines changed: 44 additions & 30 deletions

File tree

modules/manage/pages/terraform-provider.adoc

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= Redpanda Terraform Provider
22
:description: Use the Redpanda Terraform provider to create and manage Redpanda Cloud resources.
33

4-
The https://registry.terraform.io/providers/redpanda-data/redpanda/latest[Redpanda Terraform provider^] allows you to manage your Redpanda Cloud infrastructure as code using https://www.terraform.io/[Terraform^]. Terraform is an infrastructure-as-code tool that enables you to define, automate, and version-control your infrastructure configurations.
4+
Use the https://registry.terraform.io/providers/redpanda-data/redpanda/latest[Redpanda Terraform provider^] to define, automate, and track changes to your Redpanda Cloud infrastructure as code.
55

66
With the Redpanda Terraform provider, you can manage:
77

@@ -23,7 +23,7 @@ With the Redpanda Terraform provider, you can manage:
2323

2424
* **Simplicity**: Manage all your Redpanda Cloud resources in one place.
2525
* **Automation**: Create and modify resources without manual intervention.
26-
* **Version Control**: Track and roll back changes using version control systems, such as GitHub.
26+
* **Version control**: Track and roll back changes using version control systems, such as GitHub.
2727
* **Scalability**: Scale your infrastructure as your needs grow with minimal effort.
2828

2929
== Understand Terraform configurations
@@ -37,8 +37,8 @@ Providers tell Terraform how to communicate with the services you want to manage
3737
[source,hcl]
3838
----
3939
provider "redpanda" {
40-
client_id = "<your_client_id>"
41-
client_secret = "<your_client_secret>"
40+
client_id = "<client_id>"
41+
client_secret = "<client_secret>"
4242
}
4343
----
4444

@@ -56,10 +56,10 @@ resource "redpanda_network" "example" { <1>
5656
}
5757
----
5858

59-
<1> The resource type and internal name. The first part of this resource block specifies the type of resource being created. In this case, it is a `redpanda_network`, which defines a network for Redpanda Cloud. Different resource types include `redpanda_cluster`, `redpanda_topic`, and others. The second part is the internal name Terraform uses to identify this specific resource within your configuration. In this case, the internal name is `example`. This internal name allows you to reference the resource in other parts of your configuration. For example, redpanda_network.example.id can be used to access the unique ID of the network after it is created. The name does not affect the resource in Redpanda Cloud. It is for Terraform's internal use.
60-
<2> A user-defined name for the resource as it will appear in Redpanda Cloud. This is the user-facing name visible in the Redpanda UI and API.
59+
<1> The resource type (`redpanda_network`) and internal name (`example`). Terraform uses the internal name to reference the resource elsewhere in your configuration; for example, `redpanda_network.example.id` returns the network's unique ID. The internal name does not appear in Redpanda Cloud.
60+
<2> A user-defined name for the resource as it appears in Redpanda Cloud. This is the user-facing name visible in the Redpanda UI and API.
6161
<3> The cloud provider where the network is deployed, such as AWS or GCP.
62-
<4> The region where the resource will be provisioned.
62+
<4> The region where the resource is provisioned.
6363
<5> The IP address range for the network.
6464

6565
=== Variables
@@ -84,7 +84,7 @@ resource "redpanda_network" "example" {
8484

8585
Outputs let you extract information about your infrastructure, such as cluster URLs, to use in other configurations or scripts.
8686

87-
This example will display the cluster's API URL after Terraform provisions the resources:
87+
This example displays the cluster's API URL after Terraform provisions the resources:
8888

8989
[source,hcl]
9090
----
@@ -103,7 +103,23 @@ The following functionality is supported in the Cloud API but not in the Redpand
103103

104104
[WARNING]
105105
====
106-
Do not modify `throughput_tier` after it is set. When `allow_deletion` is set to `true`, modifying `throughput_tier` forces replacement of the cluster: Terraform will destroy the existing cluster and create a new one, causing data loss.
106+
If `allow_deletion` is set to `true`, modifying `throughput_tier` causes Terraform to destroy and replace the existing cluster, causing data loss.
107+
108+
To prevent this, apply one or both of the following:
109+
110+
* Set `allow_deletion` to `false`.
111+
* Add a `lifecycle` block instructing Terraform to ignore changes to `throughput_tier`:
112+
+
113+
[source,hcl]
114+
----
115+
lifecycle {
116+
ignore_changes = [
117+
throughput_tier
118+
]
119+
}
120+
----
121+
+
122+
This setting protects your cluster in the event Redpanda Support upgrades your cluster's throughput tier. Without it, the next `terraform apply` command triggers replacement.
107123
====
108124

109125
== Prerequisites
@@ -112,7 +128,7 @@ Do not modify `throughput_tier` after it is set. When `allow_deletion` is set to
112128
====
113129
*Redpanda Terraform Provider - Windows Support Notice*
114130
115-
The Redpanda Terraform provider is not supported on Windows systems. If you're using Windows, you must use Windows Subsystem for Linux 2 (WSL2) to run the Redpanda Terraform provider.
131+
The Redpanda Terraform provider does not support Windows. To use it on Windows, install Windows Subsystem for Linux 2 (WSL2).
116132
117133
To use WSL2 with the Redpanda Terraform provider:
118134
@@ -124,7 +140,7 @@ wsl --install
124140
+
125141
Then restart your computer.
126142
127-
. Open your WSL2 Linux distribution (e.g., Ubuntu) from the Start menu or by running `wsl` in PowerShell.
143+
. Open your WSL2 Linux distribution (such as Ubuntu) from the Start menu or by running `wsl` in PowerShell.
128144
. Navigate to your project directory within WSL2.
129145
. Run all Terraform commands from within your WSL2 environment:
130146
+
@@ -144,16 +160,14 @@ terraform show
144160
145161
====
146162

147-
. Install at least version 1.0.0 of Terraform using the https://learn.hashicorp.com/tutorials/terraform/install-cli[official guide^].
163+
. Install Terraform 1.0.0 or later using the https://learn.hashicorp.com/tutorials/terraform/install-cli[official guide^].
148164
. Create a service account in Redpanda Cloud:
149165
.. Log in to https://cloud.redpanda.com[Redpanda Cloud^].
150166
.. Navigate to the *Organization IAM* page and select the *Service account* tab. Click *Create service account* and provide a name for the new service account.
151167
.. Save the client ID and client secret for authentication.
152168

153169
== Set up the provider
154170

155-
To set up the provider, you need to download the provider and authenticate to the Redpanda Cloud API. You can authenticate to the Redpanda Cloud API using environment variables or static credentials in your configuration file.
156-
157171
. Add the Redpanda provider to your Terraform configuration:
158172
+
159173
[source,hcl]
@@ -175,7 +189,7 @@ terraform {
175189
terraform init
176190
----
177191

178-
. Add the credentials for the Redpanda Cloud service account you set in <<Prerequisites>>. In the Redpanda Cloud UI, find the client ID and client secret under *Organization IAM → Service accounts*. Set them as environment variables, or enter them in your Terraform configuration file:
192+
. Add the service account credentials you saved in <<Prerequisites>> as environment variables or in your Terraform configuration file:
179193
+
180194
[tabs]
181195
======
@@ -296,15 +310,15 @@ After running `terraform apply`, the provider sends the new password to Redpanda
296310

297311
== Examples
298312

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^].
313+
The following examples use 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^].
300314

301315
For more information on the different cluster types mentioned in these examples, see xref:redpanda-cloud:get-started:cloud-overview.adoc#redpanda-cloud-cluster-types[Redpanda Cloud cluster types].
302316

303317
TIP: See the full list of zones and tiers available with each cloud provider in the link:/api/doc/cloud-controlplane/topic/topic-regions-and-usage-tiers[Control Plane API reference].
304318

305319
=== Create a BYOC cluster
306320

307-
A BYOC (Bring Your Own Cloud) cluster allows you to provision a cluster in your own cloud account. This example creates a BYOC cluster on AWS with a custom network, resource group, and cluster configuration.
321+
A BYOC (Bring Your Own Cloud) cluster runs in your own cloud account. This example creates one on AWS with a custom network, resource group, and cluster.
308322

309323
[source,hcl]
310324
----
@@ -397,7 +411,7 @@ resource "redpanda_cluster" "test" {
397411

398412
=== Create a Dedicated cluster
399413

400-
A Dedicated cluster is fully managed by Redpanda and ensures consistent performance. This example provisions a cluster on AWS with specific zones and usage tiers.
414+
Redpanda fully manages Dedicated clusters for consistent performance. This example creates one on AWS with specific zones and a usage tier.
401415

402416
[source,hcl]
403417
----
@@ -543,7 +557,7 @@ variable "region" {
543557

544558
=== Manage an existing cluster
545559

546-
To manage resources in existing Redpanda Cloud clusters, you must reference the cluster using the cluster ID (Redpanda ID). The following example creates a topic in a cluster with ID `byoc-cluster-id`. The `redpanda_topic` resource contains a field `cluster_api_url` that references the `data.redpanda_cluster.byoc.cluster_api_url` data resource.
560+
To manage resources in an existing cluster, reference it by cluster ID using a `data` source. The `data` source exposes a `cluster_api_url` attribute that other resources (such as `redpanda_topic`) reference to connect to the cluster.
547561

548562
[source,hcl]
549563
----
@@ -563,7 +577,7 @@ resource "redpanda_topic" "example" {
563577

564578
You can also use Terraform to manage data plane resources, such as schemas and access controls, through the Redpanda Schema Registry.
565579

566-
The Redpanda Schema Registry provides centralized management of schemas for producers and consumers, ensuring compatibility and consistency of data serialized with formats such as Avro, Protobuf, or JSON Schema. Using the Redpanda Terraform provider, you can create, update, and delete schemas as well as manage fine-grained access control for Schema Registry resources.
580+
Use the Redpanda Terraform provider to create, update, and delete schemas and manage fine-grained access control for Schema Registry resources.
567581

568582
You can use the following Terraform resources:
569583

@@ -572,7 +586,7 @@ You can use the following Terraform resources:
572586

573587
==== Create a schema
574588

575-
The `redpanda_schema` resource registers a schema in the Redpanda Schema Registry. Each schema is associated with a subject, which serves as the logical namespace for schema versioning. When you create or update a schema, Redpanda validates its compatibility level.
589+
The `redpanda_schema` resource registers a schema. Each schema belongs to a subject, a logical name used for schema versioning. When you create or update a schema, Redpanda validates its compatibility level.
576590

577591
[source,hcl]
578592
----
@@ -627,7 +641,7 @@ For short-lived credentials or CI/CD usage, you can also export the Schema Regis
627641
[source,bash]
628642
----
629643
export REDPANDA_SR_USERNAME=schema-user
630-
export REDPANDA_SR_PASSWORD="your-secret-password"
644+
export REDPANDA_SR_PASSWORD="schema-registry-password"
631645
----
632646

633647
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:
@@ -642,12 +656,12 @@ variable "schema_password" {
642656

643657
[source,bash]
644658
----
645-
export TF_VAR_schema_password="your-secret-password"
659+
export TF_VAR_schema_password="schema-registry-password"
646660
----
647661

648662
==== Manage Schema Registry ACLs
649663

650-
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.
664+
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 which operations on a subject or the registry.
651665

652666
[source,hcl]
653667
----
@@ -673,7 +687,7 @@ In this example:
673687
* `resource_type` determines whether the ACL applies to a specific `SUBJECT` or the entire `REGISTRY`.
674688
* `resource_name` defines the subject name (use `*` for wildcard).
675689
* `pattern_type` controls how the resource name is matched (`LITERAL` or `PREFIXED`).
676-
* `operation` defines the permitted action (`READ`, `WRITE`, `DELETE`, etc.).
690+
* `operation` defines the permitted action (`READ`, `WRITE`, `DELETE`, and others).
677691
* `permission` defines whether the operation is allowed or denied.
678692
* `host` specifies the host filter (typically `"*"` for all hosts).
679693
* `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>>.
@@ -738,9 +752,9 @@ This configuration registers an Avro schema for the `user_events` subject and gr
738752

739753
== Delete resources
740754

741-
Terraform provides a way to clean up your infrastructure when resources are no longer needed. The `terraform destroy` command deletes all the resources defined in your configuration.
755+
The `terraform destroy` command deletes all resources defined in your configuration.
742756

743-
NOTE: Terraform ensures that dependent resources are deleted in the correct order. For example, a cluster dependent on a network will be removed after the network.
757+
NOTE: Terraform deletes dependent resources in the correct order. For example, Terraform removes a cluster that depends on a network before it deletes the network.
744758

745759
=== Delete all resources
746760

@@ -751,9 +765,9 @@ NOTE: Terraform ensures that dependent resources are deleted in the correct orde
751765
----
752766
terraform destroy
753767
----
754-
. Review the destruction plan Terraform generates. It will list all the resources to be deleted.
768+
. Review the destruction plan Terraform generates. It lists all the resources to be deleted.
755769
. Confirm by typing `yes` when prompted.
756-
. Wait for the process to complete. Terraform will delete the resources and display a summary.
770+
. Wait for the process to complete. Terraform deletes the resources and displays a summary.
757771

758772
=== Delete specific resources
759773

@@ -764,7 +778,7 @@ If you only want to delete a specific resource rather than everything in your co
764778
terraform destroy -target=redpanda_network.example
765779
----
766780

767-
This will delete only the `redpanda_network.example` resource.
781+
This deletes only the `redpanda_network.example` resource.
768782

769783
== Suggested reading
770784

0 commit comments

Comments
 (0)