resource "upstash_kafka_cluster" "exampleKafkaCluster" {
  cluster_name = var.cluster_name
  region       = var.region
  multizone    = var.multizone
}

resource "upstash_kafka_topic" "exampleKafkaTopic" {
  topic_name       = var.topic_name
  partitions       = var.partitions
  retention_time   = var.retention_time
  retention_size   = var.retention_size
  max_message_size = var.max_message_size
  cleanup_policy   = var.cleanup_policy
  cluster_id       = resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id
}

resource "upstash_kafka_credential" "exampleKafkaCredential" {
  cluster_id      = upstash_kafka_cluster.exampleKafkaCluster.cluster_id
  credential_name = "credentialFromTerraform"
  topic           = upstash_kafka_topic.exampleKafkaTopic.topic_name
  permissions     = "ALL"
}

resource "upstash_kafka_credential" "exampleKafkaCredentialAllTopics" {
  cluster_id      = upstash_kafka_cluster.exampleKafkaCluster.cluster_id
  credential_name = "credentialFromTerraform"
  topic           = "*"
  permissions     = "ALL"
}
resource "upstash_kafka_cluster" "exampleKafkaCluster" {
  cluster_name = var.cluster_name
  region       = var.region
  multizone    = var.multizone
}

resource "upstash_kafka_topic" "exampleKafkaTopic" {
  topic_name       = var.topic_name
  partitions       = var.partitions
  retention_time   = var.retention_time
  retention_size   = var.retention_size
  max_message_size = var.max_message_size
  cleanup_policy   = var.cleanup_policy
  cluster_id       = resource.upstash_kafka_cluster.exampleKafkaCluster.cluster_id
}

resource "upstash_kafka_credential" "exampleKafkaCredential" {
  cluster_id      = upstash_kafka_cluster.exampleKafkaCluster.cluster_id
  credential_name = "credentialFromTerraform"
  topic           = upstash_kafka_topic.exampleKafkaTopic.topic_name
  permissions     = "ALL"
}

resource "upstash_kafka_credential" "exampleKafkaCredentialAllTopics" {
  cluster_id      = upstash_kafka_cluster.exampleKafkaCluster.cluster_id
  credential_name = "credentialFromTerraform"
  topic           = "*"
  permissions     = "ALL"
}

Schema

Required

cluster_name
string
required
Name of the cluster
credential_name
string
required
Name of the kafka credential
permissions
map(string)
required
Properties that the connector will have. Please check the documentation of the related connector.
topic
map(string)
required
Name of the kafka topic

Read-Only

creation_time
number
Creation time of the credential
credential_id
string
Unique ID of the kafka credential
id
string
The ID of this resource.
password
string
Password to be used in authenticating to the cluster
state
string
State of the credential. active or deleted
username
string
Username to be used for the kafka credential