This directory contains Terraform configurations to provision environments for testing the BigQuery JDBC driver.
Located in private_service_connect/.
This environment provisions:
- A custom VPC and subnet.
- Cloud NAT (allowing outbound internet access without public IPs).
- A Private Service Connect (PSC) endpoint for Google APIs (
all-apis). - A Compute Engine VM instance with no public IP, accessible via IAP (Identity-Aware Proxy).
- Firewall rules to allow IAP SSH access.
This setup is useful for testing connectivity to BigQuery via PSC and validating that traffic goes through the private endpoint.
To deploy an environment, you need Terraform installed and configured with Google Cloud credentials.
-
Navigate to the specific environment directory:
cd tools/environments/private_service_connect -
Initialize Terraform:
terraform init
-
Create a
terraform.tfvarsfile or pass variables on the command line. Required variables:project_id: The GCP project ID where resources will be created.
Optional variables (see
variables.tffor defaults):region: Defaults tous-central1.zone: Defaults tous-central1-a.env_name: Defaults todemo.
Example
terraform.tfvars:project_id = "your-gcp-project-id" region = "us-central1" zone = "us-central1-a" env_name = "jdbc-test"
-
Plan the deployment:
terraform plan
-
Apply the configuration:
terraform apply
-
When done, you can destroy the environment:
terraform destroy