{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instaclustr/json-schema/instaclustr-kafka-user-v2-schema.json",
  "title": "KafkaUserV2",
  "description": "!> **Deprecated:** This resource is deprecated and will be removed in the next major version. Use <a href=\"https://registry.terraform.io/providers/instaclustr/instaclustr/latest/docs/resources/kafka_user_v4\"> instaclustr_kafka_user_v4</a> instead.\n\nDefinition of a Kafka User to be applied to a Kafka cluster.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instaclustr-apache-kafka-user-api-openapi.yml#/components/schemas/KafkaUserV2",
  "required": [
    "clusterId",
    "initialPermissions",
    "options",
    "password",
    "username"
  ],
  "type": "object",
  "properties": {
    "password": {
      "type": "string",
      "description": "Password for the Kafka user.",
      "format": "password",
      "x-terraform-sensitive": true,
      "x-terraform-write-only": true
    },
    "authMechanism": {
      "$ref": "#/$defs/KafkaAuthMechanismsEnumV2"
    },
    "options": {
      "$ref": "#/$defs/KafkaUserOptionsV2"
    },
    "clusterId": {
      "type": "string",
      "description": "ID of the Kafka cluster.",
      "format": "uuid",
      "x-terraform-force-new": true
    },
    "id": {
      "type": "string",
      "description": "Instaclustr identifier for the Kafka user. The value of this property has the form: [cluster-id]_[kafka-username]",
      "readOnly": true
    },
    "initialPermissions": {
      "type": "string",
      "description": "Permissions initially granted to Kafka user upon creation.",
      "enum": [
        "standard",
        "read-only",
        "none"
      ],
      "x-terraform-force-new": true,
      "x-terraform-write-only": true
    },
    "username": {
      "pattern": "^(?![zZ][oO][oO][kK][eE][eE][pP][eE][rR]$)[a-zA-Z0-9][a-zA-Z0-9_-]*$",
      "type": "string",
      "description": "Username of the Kafka user.",
      "x-terraform-force-new": true
    }
  },
  "$defs": {
    "KafkaAuthMechanismsEnumV2": {
      "type": "string",
      "description": "Authentication mechanisms supported for KafkaClusters.",
      "enum": [
        "MTLS",
        "SASL"
      ],
      "x-insta-comment": "Null value included for backwards compatibility"
    },
    "KafkaSaslScramMechanism": {
      "type": "string",
      "description": "Scram Mechanism for SASL authentication. Valid values: SCRAM-SHA-256, SCRAM-SHA-512"
    },
    "KafkaUserOptionsV2": {
      "required": [
        "saslScramMechanism"
      ],
      "type": "object",
      "properties": {
        "overrideExistingUser": {
          "type": "boolean",
          "description": "Overwrite user if already exists.",
          "x-terraform-force-new": true,
          "x-terraform-write-only": true
        },
        "saslScramMechanism": {
          "$ref": "#/$defs/KafkaSaslScramMechanism"
        }
      },
      "description": "Initial options used when creating Kafka user",
      "x-terraform-force-new": true,
      "x-terraform-write-only": true
    }
  }
}