Private Service Connect allows private consumption of services across VPC networks that belong to different groups, teams, projects, or organizations. You can publish and consume services using IP addresses that you define and that are internal to your VPC network.
You can access Google APIs and services using a Private Service Connect endpoint. You can optionally protect your API resources and data using VPC Service Controls. You can also access supported regional Google APIs and services with consumer HTTP(S) service controls.
You can connect to a service in another VPC network using a Private Service Connect endpoint.
You can make a service available outside your VPC network using a Private Service Connect service attachment.
Using Private Service Connect to access Google APIs
By default, if you have an application that uses a Google service, such as
Cloud Storage, your application connects to the default DNS name for that
service, such as
storage.googleapis.com. Even though the IP addresses for the
default DNS names are publicly routable, traffic sent from Google Cloud
resources remains within Google's network.
With Private Service Connect, you can create private endpoints
using global internal IP addresses within your VPC network. You
can assign DNS names to these internal IP addresses with meaningful names like
These names and IP addresses are internal to your VPC network and
any on-premises networks that are connected to it using Cloud VPN
tunnels or Cloud Interconnect attachments (VLANs). You can control
which traffic goes to which endpoint, and can demonstrate that traffic stays
within Google Cloud.
This option gives you access to all Google APIs and services that are included in the API bundles. If you need to restrict access to only certain APIs and services, Private Service Connect with consumer HTTP(S) service controls allows you to choose which APIs and services are made available, for supported regional service endpoints.
For more information about Private Service Connect configurations for accessing Google APIs, see use cases.
Using Private Service Connect to access Google APIs with consumer HTTP(S) service controls
You can create a Private Service Connect endpoint with consumer HTTP(S) service controls using an internal HTTP(S) load balancer. The internal HTTP(S) load balancer provides the following features:
You can choose which services are available using a URL map; filtering by path lets you do more fine-grained checks.
You can rename services, for example
spanner.example.com, and map them to URLs of your choice.
You can configure the load balancer to log all requests to Cloud Logging.
You can use customer-managed TLS certificates.
Using Private Service Connect to publish and consume services
Private Service Connect lets a service producer offer services privately to a service consumer. Private Service Connect offers the following benefits:
A service producer VPC network can support more than one service consumer.
Each consumer connects to an internal IP address that they define. Private Service Connect performs network address translation (NAT) to route the request to the service producer.
Key concepts for service consumers
You can use Private Service Connect endpoints to consume services that are outside of your VPC network. Service consumers create Private Service Connect endpoints that connect to a target service.
Endpoints and targets
You use Private Service Connect endpoints to connect to a target service. Endpoints have an internal IP address in your VPC network and are based on the forwarding rule resource.
You send traffic to the endpoint, which forwards it to targets outside of your VPC network.
|Endpoint type||Supported targets||Accessible by|
Private Service Connect endpoint to access Google APIs
global internal IP address
An API bundle:
Private Service Connect endpoint to access Google APIs with consumer HTTP(S) service controls
regional internal IP address of an internal HTTPS load balancer
|A regional service endpoint.
This endpoint is an internal HTTP(S) load balancer with a simple URL map and single backend service. To configure the target, you connect the load balancer's backend service to a Private Service Connect network endpoint group which references a regional service endpoint.
Private Service Connect endpoint to access published services in another VPC network
regional internal IP address
A published service in another VPC network. This service can be managed by your own organization or a third party.
The target for this type of endpoint is a service attachment.
Key concepts for service producers
To make a service available to consumers, you create one or more dedicated subnets to use for network address translation (NAT) of customer IP addresses. You then create a service attachment which refers to those subnets.
Private Service Connect subnets
To expose a service, the service producer first creates one or more subnets with purpose Private Service Connect.
When a request is sent from a consumer VPC network, the consumer's source IP address is translated using source NAT (SNAT) to an IP address selected from one of the Private Service Connect subnets.
If you want to retain the consumer connection IP address information, see Viewing consumer connection information.
These subnets cannot be used for resources such as VM instances or forwarding rules. The subnets are used only to provide IP addresses for SNAT of incoming consumer connections.
The Private Service Connect subnet must contain at least one IP address for every 63 consumer VMs so that each consumer VM is allocated 1,024 source tuples for network address translation.
The SNAT configuration for Private Service Connect subnets includes the following:
When SNAT is performed, each client VM in the consumer VPC network is given 1,024 source address and source port tuples using IP addresses in the Private Service Connect subnet.
The UDP Mapping Idle Timeout is 30 seconds and cannot be configured.
The TCP Established Connection Idle Timeout is 20 minutes and cannot be configured.
The TCP Transitory Connection Idle Timeout is 30 seconds and cannot be configured.
There is a two-minute delay before any 5-tuple (Private Service Connect subnet source IP address and source port plus destination protocol, IP address, and destination port) can be reused.
Service producers expose their service through a service attachment.
To expose a service, a service producer creates a service attachment that refers to the service's load balancer forwarding rule.
To access a service, a service consumer creates an endpoint that refers to the service attachment.
The service attachment URI has this format:
When you create a service, you choose how to make it available. There are two options:
Automatically accept connections for all projects - any service consumer can configure an endpoint and connect to the service automatically.
Accept connections for selected projects - service consumers configure an endpoint to connect to the service and the service producer accepts or rejects the connection requests.
Private Service Connect endpoints that you use to access Google APIs can be accessed from supported connected on-premises hosts. For more information, see Using Private Service Connect from on-premises hosts.
Private Service Connect endpoints with HTTP(S) service controls can be accessed from supported connected on-premises hosts. For more information, see Using Private Service Connect from on-premises hosts.
Private Service Connect endpoints that you use to access services in another VPC network can be accessed from supported connected on-premises hosts (using Cloud VPN only). For more information, see Using Private Service Connect from on-premises hosts.
Pricing for Private Service Connect is described in the VPC pricing page.
There are quotas for Private Service Connect endpoints and service attachments. For more information, see quotas.
Configure Private Service Connect to access Google APIs and services
Configure Private Service Connect to access Google APIs and services with consumer HTTP(S) service controls
Configure Private Service Connect to access services in another VPC network
Configure Private Service Connect to provide access to your services