confluent_kafka_mirror_topic Resource

General Availability

confluent_kafka_mirror_topic provides a Kafka Mirror Topic resource that enables creating and deleting Kafka Mirror Topics on a Kafka cluster on Confluent Cloud.

Example Usage

resource "confluent_kafka_mirror_topic" "example" {
  source_kafka_topic {
    topic_name = "orders"
  }
  cluster_link {
    link_name = confluent_cluster_link.source-outbound.link_name
  }
  kafka_cluster {
    id            = data.confluent_kafka_cluster.destination.id
    rest_endpoint = data.confluent_kafka_cluster.destination.rest_endpoint
    credentials {
      key    = confluent_api_key.app-manager-destination-cluster-api-key.id
      secret = confluent_api_key.app-manager-destination-cluster-api-key.secret
    }
  }

  lifecycle {
    prevent_destroy = true
  }
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the preceding arguments, the following attributes are exported:

Import

You can import a Kafka mirror topic by using the Kafka cluster ID, cluster link name, and Kafka topic name in the format <Kafka cluster ID>/<Cluster link name>/<Kafka topic name>, for example:

$ export IMPORT_KAFKA_API_KEY="<kafka_api_key>"
$ export IMPORT_KAFKA_API_SECRET="<kafka_api_secret>"
$ export IMPORT_KAFKA_REST_ENDPOINT="<kafka_rest_endpoint>"
$ terraform import confluent_kafka_mirror_topic.my_mirror_topic lkc-abc123/my-cluster-link/orders-123

Getting Started

The following end-to-end examples might help to get started with confluent_kafka_mirror_topic resource:

See Mirror Topics on Confluent Cloud to learn more about Mirror Topics on Confluent Cloud.