> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-vector.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# upstash_kafka_credential

> Create and manage credentials for a kafka cluster.

<RequestExample>
  ```hcl example.tf
  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"
  }
  ```
</RequestExample>

## Schema

### Required

<ParamField query="cluster_name" type="string" required>
  Name of the cluster
</ParamField>

<ParamField query="credential_name" type="string" required>
  Name of the kafka credential
</ParamField>

<ParamField query="permissions" type="map(string)" required>
  Properties that the connector will have. Please check the documentation of the
  related connector.
</ParamField>

<ParamField query="topic" type="map(string)" required>
  Name of the kafka topic
</ParamField>

### Read-Only

<ResponseField name="creation_time" type="number">
  Creation time of the credential
</ResponseField>

<ResponseField name="credential_id" type="string">
  Unique ID of the kafka credential
</ResponseField>

<ResponseField name="id" type="string">
  The ID of this resource.
</ResponseField>

<ResponseField name="password" type="string">
  Password to be used in authenticating to the cluster
</ResponseField>

<ResponseField name="state" type="string">
  State of the credential. `active` or `deleted`
</ResponseField>

<ResponseField name="username" type="string">
  Username to be used for the kafka credential
</ResponseField>
