This repo contains terraform code which provisions resources in Confluent Cloud. These resources provisioned are:
- Confluent Environment
- Confluent Kafka Cluster
- Confluent Kafka Topic
- Producer and Consumer Service Accounts
- ACL for the Producer with write permissions to topic
- ACL for the Consumer with read permissions to topic
- API keys for the Producer and Consumer applications to authenticate with Confluent Cloud.
These resources are defined in main.tf.
This is just a proof of concept so there are no deployment pipelines.
Terraform needs credentials to create resources in Confluent Cloud. Locally, we can do that by defining an API key and secret in the environment variables. These two values can be generated through the Confluent Cloud console.
export CONFLUENT_CLOUD_API_KEY=<API_KEY>
export CONFLUENT_CLOUD_API_SECRET=<API_SECRET>Initialise the Terraform project:
terraform init Create a Terraform plan:
terraform plan -out main.tfplanApply the plan and deploy resources to Confluent Cloud.
terraform apply "main.tfplan" To de-provision the deploy resources:
Terraform destroy