This is a custom Terraform provider for managing topics and schemas in Red Panda.
- Clone the repository:
git clone https://github.com/pixie79/terraform-provider-redpanda.git
cd terraform-provider-redpanda
- Build the provider:
go build -o terraform-provider-redpanda
- Install the provider:
mkdir -p ~/.terraform.d/plugins/example.com/local/redpanda/0.1.0/linux_amd64
mv terraform-provider-redpanda ~/.terraform.d/plugins/example.com/local/redpanda/0.1.0/linux_amd64/
Replace linux_amd64
with the appropriate directory for your platform if needed.
- Create a
main.tf
file:
terraform {
required_providers {
redpanda = {
source = "example.com/local/redpanda"
version = "0.1.0"
}
}
}
provider "redpanda" {
api_url = "http://localhost:8081"
}
resource "redpanda_topic" "example_topic" {
name = "example-topic"
partitions = 3
replication_factor = 1
}
resource "redpanda_schema" "example_schema" {
subject = "example-topic-value"
schema = "{\"type\": \"record\", \"name\": \"example\", \"fields\": [{\"name\": \"field1\", \"type\": \"string\"}]}"
schema_type = "AVRO"
}
Replace the api_url with the URL to your Red Panda schema registry.
- Initialize Terraform:
terraform init
- Apply the configuration:
terraform apply
- To destroy the created resources:
terraform destroy
This project is licensed under the MIT License.
This README.md
file provides an overview of the Terraform Red Panda provider, including prerequisites, build instructions, installation, and usage.