{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/instaclustr/json-schema/instaclustr-kafka-connect-mirror-v2-schema.json",
  "title": "KafkaConnectMirrorV2",
  "description": "Details of a Kafka Connect Mirror",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/instaclustr-apache-kafka-connect-mirror-v2-api-openapi.yml#/components/schemas/KafkaConnectMirrorV2",
  "required": [
    "kafkaConnectClusterId",
    "maxTasks",
    "renameMirroredTopics",
    "sourceCluster",
    "targetLatency",
    "topicsRegex"
  ],
  "type": "object",
  "properties": {
    "targetLatency": {
      "type": "integer",
      "description": "The latency in milliseconds above which this mirror will be considered out of sync. It can not be less than 1000ms. The suggested initial latency is 30000ms  for connectors to be created."
    },
    "connectors": {
      "type": "array",
      "description": "Detailed list of Connectors for the mirror.",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/kafkaConnectMirrorConnectorDetailsV2"
      }
    },
    "kafkaConnectClusterId": {
      "type": "string",
      "description": "ID of the kafka connect cluster",
      "x-terraform-force-new": true
    },
    "sourceCluster": {
      "maxItems": 1,
      "minItems": 1,
      "type": "array",
      "description": "Details to connect to the source kafka cluster",
      "items": {
        "$ref": "#/$defs/KafkaConnectMirrorSourceClusterDetailsV2"
      },
      "x-terraform-force-new": true
    },
    "maxTasks": {
      "type": "integer",
      "description": "Maximum number of tasks for Kafka Connect to use. Should be greater than 0.",
      "x-terraform-force-new": true
    },
    "renameMirroredTopics": {
      "type": "boolean",
      "description": "Whether to rename topics as they are mirrored, by prefixing the sourceCluster.alias to the topic name.",
      "x-terraform-force-new": true
    },
    "connectorName": {
      "type": "string",
      "description": "Name of the mirror connector. The value of this property has the form: [source-cluster].[target-cluster].[random-string]",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "description": "ID of the mirror",
      "format": "uuid",
      "readOnly": true
    },
    "mirroredTopics": {
      "type": "array",
      "description": "Detailed list of Mirrored topics.",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/KafkaConnectMirroredTopicDetailsV2"
      }
    },
    "topicsRegex": {
      "type": "string",
      "description": "Regex to select which topics to mirror.",
      "x-terraform-force-new": true
    },
    "status": {
      "type": "string",
      "description": "The overall status of this mirror.",
      "readOnly": true
    }
  },
  "$defs": {
    "KafkaConnectExternalSourceClusterDetailsV2": {
      "required": [
        "sourceConnectionProperties"
      ],
      "type": "object",
      "properties": {
        "sourceConnectionProperties": {
          "type": "string",
          "description": "Kafka connection properties string used to connect to external kafka cluster",
          "x-terraform-force-new": true
        }
      },
      "description": ""
    },
    "KafkaConnectManagedSourceClusterDetailsV2": {
      "required": [
        "sourceKafkaClusterId",
        "usePrivateIps"
      ],
      "type": "object",
      "properties": {
        "usePrivateIps": {
          "type": "boolean",
          "description": "Whether or not to connect to source cluster's private IP addresses.",
          "x-terraform-force-new": true
        },
        "sourceKafkaClusterId": {
          "type": "string",
          "description": "Source kafka cluster id.",
          "x-terraform-force-new": true
        }
      },
      "description": ""
    },
    "KafkaConnectMirrorSourceClusterDetailsV2": {
      "required": [
        "alias"
      ],
      "type": "object",
      "properties": {
        "alias": {
          "type": "string",
          "description": "Alias to use for the source kafka cluster. This will be used to rename topics if renameMirroredTopics is turned on",
          "x-terraform-force-new": true
        },
        "externalCluster": {
          "maxItems": 1,
          "type": "array",
          "description": "Details to connect to a Non-Instaclustr managed cluster. Cannot be provided if targeting an Instaclustr managed cluster.",
          "items": {
            "$ref": "#/$defs/KafkaConnectExternalSourceClusterDetailsV2"
          },
          "x-terraform-force-new": true
        },
        "managedCluster": {
          "maxItems": 1,
          "type": "array",
          "description": "Details to connect to a Instaclustr managed cluster. Cannot be provided if targeting a non-Instaclustr managed cluster.",
          "items": {
            "$ref": "#/$defs/KafkaConnectManagedSourceClusterDetailsV2"
          },
          "x-terraform-force-new": true
        }
      },
      "description": "Details to connect to the source kafka cluster."
    },
    "KafkaConnectMirroredTopicDetailsV2": {
      "type": "object",
      "properties": {
        "averageLatency": {
          "type": "number",
          "description": "Average latency in milliseconds for messages to travel from source to destination topics.",
          "readOnly": true
        },
        "averageRate": {
          "type": "number",
          "description": "Average record rate for messages to travel from source to destination topics, it is 0 if there are no messages travelling in between.",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "description": "Name of the mirrored topic.",
          "readOnly": true
        }
      },
      "description": "Details of a mirrored topic."
    },
    "kafkaConnectMirrorConnectorDetailsV2": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the connector. Could be one of [Mirror Connector, Checkpoint Connector].",
          "readOnly": true
        },
        "config": {
          "type": "string",
          "description": "Configuration of the connector.",
          "readOnly": true,
          "x-terraform-sensitive": true
        },
        "status": {
          "type": "string",
          "description": "Status of the connector.",
          "readOnly": true
        }
      },
      "description": "Details of a connector."
    }
  }
}