Skip to content

emmaLP/terraform-provider-confluent-schema-registry

 
 

Repository files navigation

terraform-provider-confluent-schema-registry

A terraform provider for managing schemas in a Confluent schema registry

Provider configuration

terraform {
    required_providers {
        schemaregistry = {
            source = "arkiaconsulting/confluent-schema-registry"
        }
    }
}

provider "schemaregistry" {
    schema_registry_url = "https://xxxxxx.confluent.cloud"
    username            = "<confluent_schema_registry_key>"
    password            = "<confluent_schema_registry_password>"
}

You can omit the credential details by defining the environment variables SCHEMA_REGISTRY_URL, SCHEMA_REGISTRY_USERNAME, SCHEMA_REGISTRY_PASSWORD

The schema resource

resource "schemaregistry_schema" "main" {
  subject = "<subject_name>"
  schema  = file("<avro_schema_file>")
}

The schema data source

data "schemaregistry_schema" "main" {
  subject = "<subject_name>"
}

output "schema_id" {
  value = data.schemaregistry_schema.main.id
}

output "schema_version" {
  value = data.schemaregistry_schema.main.version
}

output "schema_string" {
  value = data.schemaregistry_schema.main.schema
}

Importing an existing schema

terraform import schemaregistry_schema.main <subject_name>

About

A terraform provider for managing schemas in a Confluent schema registry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 90.0%
  • Makefile 10.0%