streamtime_kafka_topic (Resource)

A topic on a Kafka cluster. Changes are applied to the cluster at once. Partitions can be added but never removed; destroying the topic deletes its messages.

Example Usage

resource "streamtime_kafka_topic" "payments" {
  kafka              = streamtime_kafka.orders.identifier
  name               = "payments"
  partitions         = 6
  replication_factor = 3

  config = {
    "retention.ms"   = "604800000"
    "cleanup.policy" = "delete"
  }
}

Schema

Required

  • kafka (String) Identifier of the streamtime_kafka cluster the topic is on. Changing it creates a new topic.
  • name (String) Topic name: letters, digits, dots, underscores and dashes, up to 249 characters. Changing it creates a new topic.
  • partitions (Number) Number of partitions. It can only be raised; lowering it is an error.
  • replication_factor (Number) Copies of each partition kept on different brokers. Changing it creates a new topic, deleting its messages.

Optional

  • config (Map of String) Topic settings, for example retention.ms or cleanup.policy. Only the settings listed here are managed; removing one returns it to the cluster’s default.

Read-Only

  • id (String) /. Import with the same value.

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

# Import by <kafka>/<topic name>.
terraform import streamtime_kafka_topic.payments orders/payments