Provisions a private IP bastion host on Google Cloud for use as a proxy to a private IP Kafka instance.
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.
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
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"