Skip to content

Commit ea14a5a

Browse files
committed
Add comments for access to MM2 clusters and other fixes.
1 parent 91d48c7 commit ea14a5a

File tree

1 file changed

+14
-5
lines changed
  • managedkafka/managedkafka_create_connector_mirrormaker2_source

1 file changed

+14
-5
lines changed

managedkafka/managedkafka_create_connector_mirrormaker2_source/main.tf

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ resource "google_managed_kafka_connect_cluster" "default" {
6767
access_config {
6868
network_configs {
6969
primary_subnet = google_compute_subnetwork.default.id
70+
# As part of the configuration, ensure the Connect cluster has necessary access
71+
# to all MM2 source/target Kafka clusters. For more information on providing access,
72+
# see the documentation.
73+
# As an example, we enable network access to Kafka Clusters below using DNS domain names.
74+
# The format for DNS name should be:
75+
# "GMK_CLUSTER_ID.REGION.managedkafka.PROJECT_ID.cloud.goog.*"
76+
# Please note that we do NOT need to add the DNS name of the primary Kafka cluster to the
77+
# `dns_domain_names` list, as our Connect cluster is already connected to that.
78+
dns_domain_names = ["DNS_DOMAIN_NAME"]
7079
}
7180
}
7281
}
@@ -106,13 +115,13 @@ resource "google_managed_kafka_connector" "default" {
106115
"source.cluster.alias" = "source"
107116
"target.cluster.alias" = "target"
108117
"topics" = ".*" # Replicate all topics from the source
109-
# The value for bootstrap.servers is a comma-separated list of hostname:port pairs for one
110-
# or more Kafka brokers in the source/target cluster.
118+
# The value for bootstrap.servers is a comma-separated list of hostname:port pairs
119+
# for one or more Kafka brokers in the source/target cluster.
111120
"source.cluster.bootstrap.servers" = "source_cluster_dns"
112121
"target.cluster.bootstrap.servers" = "target_cluster_dns"
113-
# Using a replication policy is a good practice to identify mirrored topics.
114-
# It prefixes the topic name with the source alias (e.g., "source.my-topic").
115-
"replication.policy.class" = "org.apache.kafka.connect.mirror.DefaultReplicationPolicy"
122+
# You can define an exclusion policy for topics as follows:
123+
# To exclude internal MirrorMaker 2 topics, internal topics and replicated topics,.
124+
"topics.exclude" = "mm2.*\\.internal,.*\\.replica,__.*"
116125
}
117126

118127
provider = google-beta

0 commit comments

Comments
 (0)