This provider is built using the Terraform Plugin Framework.
- Terraform 1.0+
- Go 1.16+ (if you plan to build the provider from the source)
If you want to build the provider from source, follow these steps:
- Clone the repository
- Run
make tidy
to install dependencies - Build the provider using
make build
- Run tests with
make testacc
The acceptance tests rely on Testcontainers for Go (Redpanda) to provide a Schema Registry API. This has some limitations:
- Redpanda only supports
AVRO
andPROTOBUF
encoding, cannot testJSON
schemas [1]
If you're building the provider, follow the instructions to
install it as a plugin.
After placing it into your plugins directory, run terraform init
to initialize it.
terraform {
required_providers {
schemaregistry = {
source = "cultureamp/schemaregistry"
version = "1.2.2"
}
}
}
provider "schemaregistry" {
schema_registry_url = "https://schemaregistry.example.com"
username = "your-username"
password = "your-password"
}
resource "schemaregistry_schema" "example" {
subject = "example"
schema_type = "AVRO"
compatibility_level = "NONE"
hard_delete = false
schema = file("path/to/your/schema.avsc")
# optional list of schema references
references = [
{
name = "ref-schema-name-1"
subject = schemaregistry_schema.ref_schema_1.subject
version = schemaregistry_schema.ref_schema_1.version
},
]
}