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-internal
- Build the provider:
go build -o terraform-provider-internal
- Install the provider:
mkdir -p ~/.terraform.d/plugins/example.com/local/internal/0.1.0/linux_amd64
mv terraform-provider-internal ~/.terraform.d/plugins/example.com/local/internal/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/internal"
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 "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.