streamtime_kafka_schema (Resource)
A subject in a Kafka cluster’s schema registry, and its latest schema. Changing the schema registers a new version; earlier versions stay in the registry. The cluster must have a schema registry, and its fleet a recent Agent.
Example Usage
resource "streamtime_kafka_schema" "payments_value" {
kafka = streamtime_kafka.orders.identifier
subject = "payments-value"
schema_type = "avro"
schema = file("${path.module}/payment.avsc")
# Optional: the subject's own level. Leave it out to use the registry's default.
compatibility = "BACKWARD"
# Destroy soft-deletes the subject unless this is true.
hard_delete = false
}
Schema
Required
kafka(String) Identifier of the streamtime_kafka cluster whose schema registry holds the subject. Changing it creates a new subject.schema(String) The schema text, at most 1 MiB, for example file(“payment.avsc”). Schemas that reference other schemas are not supported. A change registers a new version, which the subject’s compatibility level must allow. Avro and JSON Schema texts that differ only in formatting are not a change.schema_type(String) avro, json (JSON Schema) or protobuf. Changing it creates a new subject.subject(String) Subject name, usually<topic>-valueor<topic>-key, without / or . If the subject already exists, its versions are kept, the configured compatibility level is applied, and then the schema is registered as its next version. Changing it creates a new subject.
Optional
compatibility(String) The subject’s own compatibility level: BACKWARD, BACKWARD_TRANSITIVE, FORWARD, FORWARD_TRANSITIVE, FULL, FULL_TRANSITIVE or NONE. Leave it out to use the registry’s default; removing it clears the subject’s level. A changed level applies before a changed schema is registered.hard_delete(Boolean) When true, destroying the resource removes the subject permanently, and messages written with its schemas can no longer be decoded. When false (the default), the subject is soft-deleted: its schemas and IDs are kept, and it can be removed permanently in Streamtime later.
Read-Only
id(String)<kafka>/<subject>. Import with the same value.schema_id(Number) The registry’s ID for the latest schema, as carried in messages.version(Number) The subject’s latest version number.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Import by <kafka>/<subject>.
terraform import streamtime_kafka_schema.payments_value orders/payments-value