terraform-provider-redpanda

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 5 Imported by: 0

README

Terraform Red Panda Provider

This is a custom Terraform provider for managing topics and schemas in Red Panda.

Prerequisites

Building the provider

  1. Clone the repository:
git clone https://github.com/pixie79/terraform-provider-redpanda.git
cd terraform-provider-internal
  1. Build the provider:
go build -o terraform-provider-internal
  1. 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.

Using the provider

  1. 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.

  1. Initialize Terraform:
terraform init
  1. Apply the configuration:
terraform apply
  1. To destroy the created resources:
terraform destroy

License

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
provider
Package provider provider.go
Package provider provider.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL