KPD closed beta Sign inRequest access

Terraform

Generate a Terraform starting point for the Confluent provider from your design, with every credential left to your CI.

The Terraform page: checks and advice first, then the files.
The Terraform page: checks and advice first, then the files.

Generating

Choose Export → Terraform… The page shows three things in order:

  1. Errors from validation, which block generating until they are fixed: for example two pipelines that describe the same topic differently.
  2. Permission advice: role bindings your running assets seem to need, each unticked. Tick the ones you want; KPD never adds them for you (see Service accounts and access).
  3. The files, to preview, then Download .zip to take them away, or Write to exports/terraform/ to keep them with the project (they’re then in its Export project (.zip) too).

What is generated

One root module, with a file per pipeline:

FileContents
versions.tf, providers.tfTerraform and Confluent provider versions; the provider with credentials from variables only.
environments.tfExisting environments, clusters, Schema Registry and Flink regions, referred to by id.
service-accounts.tfService accounts and their role bindings, as you entered them.
api-keys.tfAPI keys for accounts ticked to have one.
flink-compute-pools.tfCompute pools (existing pools are referred to by id).
governance.tfStream Catalog tags and business metadata definitions.
pipeline-<name>.tfEach pipeline's topics, schemas with contract rules, tag and metadata bindings, connectors, Flink statements and ksqlDB clusters.
flink/<statement>.sqlThe SQL of each Flink statement, in its own file named after the statement (for example flink/booking-raw-to-cdm.sql). The pipeline's .tf loads it with file(), so the SQL can be reviewed and changed as SQL.
schemas/The schema files the confluent_schema resources load.
variables.tf, outputs.tf, terraform.tfvars.exampleEvery credential and connector secret as a sensitive variable, plus any setting a connector needs that the design doesn’t hold (usually its login user name); useful outputs.
README.md, .gitignoreWhat was included and left out, the TODOs, and how to run it.
NoteRe-exporting replaces only the files KPD wrote (listed in .kpd-generated.json), so files you add to the folder are kept.

Running it

Unzip the download (or the exports/terraform folder of an exported project) where your team keeps infrastructure code, then:

cd terraform
export TF_VAR_confluent_cloud_api_key=…      # from your CI secret store
export TF_VAR_confluent_cloud_api_secret=…
terraform init
terraform plan

OpenTofu works the same way (tofu init, tofu plan). The output is checked with tofu validate against the Confluent provider schema.

Review before applyingThis is a starting point, not a deployment. Review the plan, add a remote backend for state, and keep state encrypted: API key secrets exist only in state and sensitive outputs.