Skip to main content

Connecting Validata Cloud on Google Cloud Platform to managed data services

This topic explains how to enable private connectivity from Validata Cloud on Google Cloud Platform to managed Google Cloud services. Private Service Connect allows Validata Cloud to access these services without exposing traffic to the public internet.

There are two main approaches for connecting to managed Google Cloud services:

  • Google APIs via the allgoogleapis endpoint: For services like BigQuery that are accessed through Google APIs.

    validata-gcp-priv-conn-manag-goog-api.png
  • Customer-managed databases via your infrastructure: For services like Cloud SQL that require routing through your own GCP project infrastructure.

    validata-gcp-priv-conn-manag-psc-attach.png

Connecting to Google APIs

Use this approach for Google Cloud services that are accessed through standard Google APIs, including BigQuery. This method uses Google Cloud's built-in allgoogleapis Private Service Connect endpoint.

Overview

Google Cloud's Private Service Connect routes traffic to Google APIs privately over Google's network. This keeps data off the public internet while preserving full functionality for supported services such as BigQuery, MySQL, and PostgreSQL. The same flow applies across these services.

Supported data systems

  • BigQuery

  • MySQL

    • Google Cloud SQL for MySQL

  • PostgreSQL

    • Google AlloyDB for PostgreSQL

    • Google Cloud SQL for PostgreSQL

Prerequisites

  • Access to the Validata Cloud console with Admin permissions to create endpoints and apps.

  • The Validata service must be in the Running state.

Implementation steps

This process creates a PSC endpoint that connects to Google's allgoogleapis service, providing private access to supported Google Cloud services.

  1. Log in to the Validata Cloud portal.

  2. Select the service that you want to create a Private Service Connect from.

  3. Under the Secure connection tab, choose Create Private Service Connect.

    gcp-psc-google-api-1.png
  4. Use a unique name for this connection.

  5. Leave the Service attachment field empty and select Create.

    gcp-psc-google-api-2.png
  6. An endpoint named for allgoogleapis will be created. Wait until its status is Running, then note the endpoint name to use in the application connection configuration.

    gcp-psc-google-api-3.png

Connecting to customer-managed databases

Use this approach for managed Google Cloud databases like Cloud SQL that require routing through your own GCP project infrastructure. This method requires setting up Private Service Connect infrastructure in your GCP project.

Overview

This pattern routes traffic from Validata Cloud through a Private Service Connect attachment in your GCP project to reach managed databases like Cloud SQL. The connection uses your project's network infrastructure to provide private connectivity.

Supported services

  • Cloud SQL

  • Cloud PostgreSQL

  • Cloud MySQL

Prerequisites

  • A VPC network with one additional subnet for PSC.

  • IAM rule for the user with above services creation permission.

  • A CloudSQL database with a private IP.

    gcp-psc-managed-database-1.png

Step-by-step process to set up the network pipeline in customer project

This process establishes the necessary infrastructure in your GCP project to route traffic privately from Validata Cloud to your managed databases.

  1. Create an Ubuntu VM instance with the following:

    • An e2-medium should be sufficient for this solution.

    • Launch the instance in the same VPC network as the database.

    • SSH to the instance and set up an IP forwarding rule to forward all incoming traffic to the database by using the commands below (change the IP and port accordingly for your target database).

      • Determine if forwarding is currently enabled or disabled. The command below outputs the value of the given parameter. A value of 1 indicates that the setting is enabled, while 0 indicates it is disabled.

    sudo sysctl net.ipv4.ip_forward
    • Open the file /etc/sysctl.conf using your preferred command-line editor, such as vi.

    sudo vi /etc/sysctl.conf
    • Find the line corresponding with the type of forwarding you wish to enable, uncomment it, and set the value to 1. Alternatively, you can add the lines anywhere in the file.

    • After the changes have been saved, apply the changes by running the following command or by rebooting the machine.

    sudo sysctl -p
    • Review the existing iptables rules. If you are on a fresh installation of Linux and do not have any preconfigured rules, the output of the command below should be empty.

    sudo iptables-save
    • Configure iptables to allow port forwarding. This is the default setting for many systems.

    sudo iptables -A FORWARD -j ACCEPT
    • Run the following commands to set up the forwarding rule in the iptable:

    sudo iptables -t nat -A PREROUTING -p tcp --dport 5432 -j DNAT --to-destination
    sudo iptables -t nat -A POSTROUTING -j MASQUERADE
    sudo cat /proc/sys/net/ipv4/ip_forward
    sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
    sudo iptables-save
    • To make this rule persistent during reboot, download the iptables-persistent package (press yes in the popup window to acknowledge).

    sudo apt install iptables-persistent
    • To review the iptables rule:

    iptables -t nat -nvL
  2. Go to the Compute Engine portal and choose Instance groups on the left panel.

  3. Select Create instance group.

  4. Choose New unmanaged instance group.

  5. Enter an instance group name, location, zone, and other information:

    • For location and zone, choose the same location and zone as the proxy instance that you created.

    • For network interface, choose the same VPC, subnet, and instance VM that you created or used earlier for the proxy instance.

    • Choose Create.

      gcp-psc-managed-database2.png
  6. Create a load balancer:

    • Choose TCP load balancer.

    • Select Only between my VMs, Single region only, Pass-through, then choose Continue.

      gcp-psc-managed-database3.png
    • Give it a name and choose the same region and network as the proxy VM instance.

    • In the backend configuration, choose the instance group you created.

      gcp-psc-managed-database4.png
    • Create a health check probe for the port you assigned for your database.

    • Select Frontend configuration.

    • Enter a name for the configuration.

    • Select the same network you have been using.

    • Choose an internal IP purpose, shared or non-shared.

    • For ports, choose all or any specific port(s).

    • Disable global access.

    • Choose Create.

      gcp-psc-managed-database5.png
  7. Go to the Load balancer portal.

  8. Select Private service connect on the left panel.

    • Select Published service, then choose Create new.

    • In the configuration, choose the load balancer type that you created before and select the load balancer from the dropdown.

    • Give it a name.

    • In the subnet section, choose Reserve a subnet for PSC.

    • Enter a subnet name and a CIDR block with /24.

      gcp-psc-managed-database6.png
    • Choose connection preference Accept connections for selected projects.

    • Select Add service to create this service.

  9. After creating the service, select the service and copy the Service attachment. You will need this attachment to create a PSC connection in the Validata Cloud console.

    gcp-psc-managed-database7.png

Create a Private Service Connection in the Validata Cloud project

Once the customer infrastructure is ready, create the corresponding PSC endpoint in Validata Cloud to establish the connection.

  1. Log in to the Validata Cloud console.

  2. Select the service that you want to create a Private Service Connect from.

  3. Under the Secure connection tab, choose Create Private Service Connect.

    gcp-psc-managed-database8.png
  4. Use a unique name for this connection.

  5. Paste the private service attachment URL that you copied previously and select Create. The attachment looks like:

    projects/striim-tools/regions/us-central1/serviceAttachments/psc-demo-service
    gcp-psc-managed-database9.png
  6. You have now created a PSC connection endpoint. It is in a pending state until the request is accepted.

  7. Once the request is approved from the PSC published service portal, the endpoint status changes to "Running".

    gcp-psc-managed-database10.png

Accept PLS connection request in customer project

The final step is to approve the connection request from your GCP project.

  1. Go to the Private Service Connect portal, then the published service.

  2. Select the published service.

  3. You will see a request in the pending state.

    gcp-psc-managed-database11.png
  4. You have a choice to Accept or Reject the request.

    gcp-psc-managed-database12.png
  5. Reject will refuse the new connection request or disconnect the existing connection.