nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #258

You have deployed a Java application to Cloud Run. Your application requires access to a database hosted on Cloud SQL. Due to regulatory requirements, your connection to the Cloud SQL instance must us

The correct answer is B. Configure your Cloud Run service to use a Serverless VPC Access connector.. Cloud Run is a serverless platform that operates outside of a customer VPC by default, meaning it cannot reach internal (RFC 1918) IP addresses without additional configuration. A Serverless VPC Access connector bridges Cloud Run to a VPC network, allowing outbound traffic to int

Integrating Google Cloud services with applications

Question

You have deployed a Java application to Cloud Run. Your application requires access to a database hosted on Cloud SQL. Due to regulatory requirements, your connection to the Cloud SQL instance must use its internal IP address. How should you configure the connectivity while following Google-recommended best practices?

Options

  • AConfigure your Cloud Run service with a Cloud SQL connection.
  • BConfigure your Cloud Run service to use a Serverless VPC Access connector.
  • CConfigure your application to use the Cloud SQL Java connector.
  • DConfigure your application to connect to an instance of the Cloud SQL Auth proxy.

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    77% (17)
  • C
    5% (1)
  • D
    14% (3)

Explanation

Cloud Run is a serverless platform that operates outside of a customer VPC by default, meaning it cannot reach internal (RFC 1918) IP addresses without additional configuration. A Serverless VPC Access connector bridges Cloud Run to a VPC network, allowing outbound traffic to internal IPs - including the private IP of a Cloud SQL instance. This is the Google-recommended practice for accessing VPC resources from serverless environments. Option A (Cloud SQL connection configuration in Cloud Run) typically leverages the Cloud SQL Auth Proxy over a Unix socket, which goes through the Cloud SQL API endpoint (public path) rather than enforcing private IP connectivity. Option C (Cloud SQL Java connector) can use private IP but still requires VPC connectivity to reach the internal address - without the connector in place, it alone is insufficient. Option D (Cloud SQL Auth Proxy as a sidecar) also needs VPC access to reach the internal IP, and running a sidecar in Cloud Run adds complexity.

Topics

#Cloud Run#Cloud SQL#Private Networking#Serverless VPC Access

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice