tree: f10475af50afa8b80acae4642e6399e0a3b42dc9 [path history] [tgz]
  1. .terraform.lock.hcl
  2. common.tfvars
  3. compute.tf
  4. prerequisites.tf
  5. provider.tf
  6. README.md
  7. variables.tf
.test-infra/kafka/proxy/README.md

Kafka proxy

Provisions a private IP bastion host on Google Cloud for use as a proxy to a private IP Kafka instance.

Prerequisites

Usage

Acquire bootstrap server hosts

One of the variables requires a mapping of bootstrap server hosts to the desired proxy exposed port. See the variable description for bootstrap_endpoint_mapping found in the variables.tf file.

Apply module

Follows typical terraform workflow without the use of a backend.

DIR=.test-infra/kafka/proxy
terraform -chdir=$DIR init
terraform -chdir=$DIR apply -var-file=common.tfvars -var-file=name_of_your_specific.tfvars

Invoke gcloud ssh tunneling command

Successful application of the module will output the specific gcloud command needed to tunnel the kafka traffic to your local machine. An example of such output would look similar to:

gcloud compute ssh yourinstance --tunnel-through-iap --project=project --zone=zone --ssh-flag="-4 -L9093:localhost:9093" --ssh-flag="-4 -L9092:localhost:9092" --ssh-flag="-4 -L9094:localhost:9094"