Skip to content

Conversation

@salmany
Copy link
Contributor

@salmany salmany commented Jul 29, 2025

Adds Terraform samples for Managed Kafka Connect
to create connectors for BigQuery, Cloud Storage, MirrorMaker,
Pub/Sub Sink, and Pub/Sub Source.

Builds upon #876 and requires a fix for subnet resource (see here).

Description

Fixes https://b.corp.google.com/issues/430087669

Note: If you are not associated with Google, open an issue for discussion before submitting a pull request.

Checklist

Readiness

  • Yes, merge this PR after it is approved
  • No, don't merge this PR after it is approved

Style

Testing

Intended location

  • Yes, this sample will be (or already is) included on cloud.google.com
    Location(s):
  • No, this sample won't be included on cloud.google.com
    Reason:

API enablement

  • If the sample needs an API enabled to pass testing, I have added the service to the Test setup file

Review

  • If this sample adds a new directory, I have added codeowners to the CODEOWNERS file

salmany and others added 7 commits July 23, 2025 18:10
for Clusters

* Add sample code for creating a Kafka Connect
cluster
Corrected tags.
for Connectors

Adds Terraform samples for Managed Kafka Connect
to create connectors for BigQuery, Cloud Storage, MirrorMaker,
Pub/Sub Sink, and Pub/Sub Source.
@salmany salmany changed the base branch from salman-mkc-code-examples to main July 29, 2025 18:00
@salmany salmany marked this pull request as ready for review July 29, 2025 19:34
@salmany salmany requested review from a team as code owners July 29, 2025 19:34
@snippet-bot
Copy link

snippet-bot bot commented Jul 29, 2025

Here is the summary of changes.

You are about to add 15 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@glasnt glasnt added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 1, 2025
Copy link
Contributor

@glasnt glasnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a replacement for #876? It conflicts with that sample.

@salmany salmany requested a review from glasnt August 5, 2025 00:09
@glasnt
Copy link
Contributor

glasnt commented Aug 7, 2025

#876 has been merged, which conflicts with this branch. Please rebase, and apply suggested comments around local-exec and test skips ✨

@salmany
Copy link
Contributor Author

salmany commented Aug 7, 2025

Rebased and applied mitigation for subnet resource destruction issue.

@salmany salmany requested a review from rQ-Qrr August 11, 2025 18:31
@glasnt glasnt removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 11, 2025
@salmany salmany enabled auto-merge (squash) August 14, 2025 14:22
Comment on lines +82 to +83
"name" = "my-bigquery-sink-connector"
"project" = "GCP_PROJECT_ID"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look like repeated values from the main resource args. If that's the case, you can use the dynamic project ID rather than hardcoding it here.

Suggested change
"name" = "my-bigquery-sink-connector"
"project" = "GCP_PROJECT_ID"
"name" = "my-bigquery-sink-connector"
"project" = data.google_project.default.project_id

"tasks.max" = "3"
"kafka.topic" = "GMK_TOPIC_ID"
"cps.subscription" = "CPS_SUBSCRIPTION_ID"
"cps.project" = "GCP_PROJECT_ID"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same again here

Suggested change
"cps.project" = "GCP_PROJECT_ID"
"cps.project" = data.google_project.default.project_id

Copy link
Contributor

@glasnt glasnt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small best practice addition, and these are okay to merge.

@salmany salmany merged commit 58da4e9 into main Aug 14, 2025
10 checks passed
glasnt added a commit that referenced this pull request Aug 14, 2025
salmany pushed a commit that referenced this pull request Aug 14, 2025
Follow up to #878, minor fix for hardcoded project IDs.
niharika-98 pushed a commit to niharika-98/terraform-docs-samples that referenced this pull request Sep 7, 2025
…es#878)

* docs: Add Managed Kafka Connect terraform sample
for Clusters

* Add sample code for creating a Kafka Connect
cluster

* Update tags in main.tf

Corrected tags.

* Addressed PR comments.

* Add comment to clarify memory_bytes value.

* Fix incorrect Kafka cluster reference.

* docs: Add Managed Kafka Connect terraform sample
for Connectors

Adds Terraform samples for Managed Kafka Connect
to create connectors for BigQuery, Cloud Storage, MirrorMaker,
Pub/Sub Sink, and Pub/Sub Source.

* Fix typo in memory_bytes for connectors

* Fixed formatting.

* Fix formatting

* Fix snippet tags.

* Fix tags

* Adding workaround for subnet resource deletion.

* Fixed errors and formatting.

* Disable tests and modify subnet resources.

* Updated connector sample configs.

* Fix formatting.

* Add comment for MM connector target cluster.

* Change MM2 example to include 2 GMK clusters.

* Fix connector name to match id.

* Fix connector bootstrap server addresses.

* Fix bootstrap server addresses and add comment.

* Fix whitespaces and formatting.

* Add newline.

* Add comments for access to MM2 clusters and other fixes.

* Formatting fix.

* Applying suggestions.

---------

Co-authored-by: Katie McLaughlin <[email protected]>
niharika-98 pushed a commit to niharika-98/terraform-docs-samples that referenced this pull request Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants