# Not necessary if the topic belongs to an already created cluster.
resource "upstash_kafka_cluster" "exampleKafkaCluster" {
  cluster_name = "Terraform_Upstash_Cluster"
  region       = "eu-west-1"
  multizone    = false
}

resource "upstash_kafka_topic" "exampleKafkaTopic" {
  topic_name       = "TerraformTopic"
  partitions       = 1
  retention_time   = 625135
  retention_size   = 725124
  max_message_size = 829213
  cleanup_policy   = "delete"

  # Here, you can use the newly created kafka_cluster resource (above) named exampleKafkaCluster.
  # And use its ID so that the topic binds to it.
  # Alternatively, provide the ID of an already created cluster.
  cluster_id = resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id
}
# Not necessary if the topic belongs to an already created cluster.
resource "upstash_kafka_cluster" "exampleKafkaCluster" {
  cluster_name = "Terraform_Upstash_Cluster"
  region       = "eu-west-1"
  multizone    = false
}

resource "upstash_kafka_topic" "exampleKafkaTopic" {
  topic_name       = "TerraformTopic"
  partitions       = 1
  retention_time   = 625135
  retention_size   = 725124
  max_message_size = 829213
  cleanup_policy   = "delete"

  # Here, you can use the newly created kafka_cluster resource (above) named exampleKafkaCluster.
  # And use its ID so that the topic binds to it.
  # Alternatively, provide the ID of an already created cluster.
  cluster_id = resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id
}

Schema

Required

cleanup_policy
string
required
Cleanup policy will be used in the topic. compact or delete
cluster_id
string
required
ID of the cluster the topic will be deployed in
max_message_size
number
required
Max message size in the topic
partitions
number
required
The number of partitions the topic will have
retention_size
number
required
Retention size of the messages in the topic
retention_time
number
required
Retention time of messages in the topic
topic_name
string
required
Name of the topic

Read-Only

creation_time
number
Creation time of the topic
id
string
The ID of this resource.
multizone
bool
Whether multizone replication is enabled
password
string
Password to be used in authenticating to the cluster
region
string
Region of the kafka topic
rest_endpoint
string
REST endpoint of the kafka topic
state
string
State of the credential. active or deleted
tcp_endpoint
string
TCP endpoint of the kafka topic
topic_id
string
Unique cluster ID for created topic
username
string
Base64 encoded username to be used in authenticating to the cluster