Professional Cloud Database Engineer Exam QuestionsBrowse all questions from this exam

Professional Cloud Database Engineer Exam - Question 55


You are writing an application that will run on Cloud Run and require a database running in the Cloud SQL managed service. You want to secure this instance so that it only receives connections from applications running in your VPC environment in Google Cloud. What should you do?

Show Answer
Correct Answer: D

To secure the Cloud SQL instance so that it only receives connections from applications running in your VPC environment in Google Cloud, follow these steps: Create the instance with a specified internal (private) IP address to limit exposure to the internet. Choose the VPC with private service connection configured to ensure internal communication within the VPC. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance to enable Serverless applications (like Cloud Run) to access resources in the VPC. Finally, connect to the instance using a connection pool to manage connections efficiently and enhance reliability. This method ensures secure and direct connections without needing a Cloud SQL Auth proxy, which is more suitable when dealing with public IP connections.

Discussion

24 comments
Sign in to comment
chelbsikOption: D
Dec 25, 2022

It's D, CloudSQL Auth proxy is not used when connecting to Private IP https://cloud.google.com/sql/docs/mysql/connect-run#configure https://cloud.google.com/sql/docs/mysql/connect-run#connection-pools

gabrielosluz
Feb 22, 2023

The Cloud SQL Auth proxy works with both public and private IP endpoints: https://cloud.google.com/sql/docs/mysql/connect-auth-proxy

dynamic_dba
Mar 13, 2023

D. Cloud Run to Cloud SQL connectivity can be done using private IPs. Eliminate A and B. C would be right except you wouldn’t use Cloud SQL Auth Proxy because Serverless VPC Access would connect directly to the Cloud SQL instance. The connection pool reference in D puts you off, but it is the right answer. The link provided by SVGoogle89 is spot on.

GCP72Option: C
Dec 28, 2022

C is the correct answer Requirements for using the Cloud SQL Auth proxy To use the Cloud SQL Auth proxy, you must meet the following requirements: The Cloud SQL Admin API must be enabled. You must provide the Cloud SQL Auth proxy with Google Cloud authentication credentials. You must provide the Cloud SQL Auth proxy with a valid database user account and password. The instance must either have a public IPv4 address, or be configured to use private IP. The public IP address does not need to be accessible to any external address (it does not need to be added as an authorized network address).

sp57
Dec 31, 2022

Agree with chelbsik's point re. Cloud SQL Auth proxy not required with Cloud Run - vote D.

SVGoogle89
Jan 3, 2023

D. https://cloud.google.com/sql/docs/mysql/connect-run#private-ip_1

examprof
Dec 13, 2023

Option D. This link explicitly indicates that "For private IP paths, your application will connect directly to your instance through Serverless VPC Access. This method uses TCP to connect directly to the Cloud SQL instance without using the Cloud SQL Auth Proxy." https://cloud.google.com/sql/docs/mysql/connect-run#connect_to

pk349
Dec 25, 2022

C: Create your instance with a specified internal (private) IP address. Choose the VPC with private service connection configured. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. Use Cloud SQL Auth *** proxy to connect to the instance.

abdenagoOption: D
Jun 14, 2023

auth proxy isn't required with private serverless access, the connection pool increases reliability of the connection

CloudKidaOption: C
Jun 28, 2023

https://cloud.google.com/sql/docs/mysql/connect-overview Configuring your instance with a private IP is preferred when connecting from a client on a resource with access to a VPC. For more information about what resources can use private IP, see Requirements for Private IP. For private IP paths, the following services and applications connect directly to your instance through Serverless VPC Access: App Engine standard environment App Engine flexible environment Cloud Functions Cloud Run

ewelazOption: D
Sep 27, 2023

it's d, Auth proxy is not used when connecting to Private IP

PKookNNOption: D
Jan 22, 2024

https://cloud.google.com/sql/docs/mysql/connect-run#connect_to - said clearly that there is no need for Cloud SQL Auth Proxy when using with Cloud Run.

Pime13Option: D
Apr 30, 2024

D: https://cloud.google.com/sql/docs/mysql/connect-run#connect

NircaOption: D
Mar 7, 2023

Going for D. "The Cloud SQL Auth proxy is a Cloud SQL connector that provides secure access to your instances without a need for Authorized networks or for configuring SSL." and in our scenario, we have a VPC.

Pilot50Option: C
Apr 5, 2023

not a great question, bot C and D are acceptable based on this google doc https://cloud.google.com/sql/docs/mysql/connect-run#best-practices

KennyHuangOption: C
May 28, 2023

The Cloud SQL Auth proxy provides a secure connection between your application running on Cloud Run and the Cloud SQL instance. It handles authentication and encrypts traffic.

Sandipcst
Jun 18, 2023

C Cloud SQL Auth Proxy can connect Cloud SQL instance with private ip by specifying --private-ip argument in same VPC. Cloud Run can run a container that gets the auth proxy installable files and run the auth proxy in cloud Run in same VPC.

learnazureportal
Sep 6, 2023

correct answer is C - The Cloud SQL Auth proxy acts as a secure intermediary between your Cloud Run application and the Cloud SQL instance, allowing for secure and authenticated database connections while keeping the database inaccessible from the public internet.

nqthien041292Option: C
Sep 6, 2023

Vote C

juliorevkOption: C
Oct 3, 2023

https://cloud.google.com/sql/docs/mysql/connect-auth-proxy "Works with both public and private IP endpoints"

nhiguchiOption: C
Nov 5, 2023

C is correct.

AngieSoccerBall49
Nov 29, 2023

D is the correct answer. A common misconception.

AngieSoccerBall49
Nov 29, 2023

When using Cloud Run to connect to Cloud SQL Private IP addresses, it is unnecessary to use the SQL Auth Proxy in Private IP mode. The Serverless VPC Access Connector (which has been superceded by Cloud Run's direct VPC Egress) should connect directly and leverage a connection pooler (potentially in your application via client library, probably better as a separate instance) for more consistent connections to the Cloud SQL DB. You would create a specific "user" for this purpose in your database.

LaxmanTiwari
Jan 16, 2024

API Quota Limits Cloud Run provides a mechanism that connects using the Cloud SQL Auth Proxy, which uses the Cloud SQL Admin API. API quota limits apply to the Cloud SQL Auth Proxy. The Cloud SQL Admin API quota used is approximately two times the number of Cloud SQL instances configured by the number of Cloud Run instances of a particular service deployed at any one time. You can cap or increase the number of Cloud Run instances to modify the expected API quota consumed.

LaxmanTiwari
Jan 16, 2024

Selected Answer: C

rglearnOption: D
Oct 25, 2024

cloud Run has built in SQL auth Proxy hence we dont need to it use it explicitly.

kropOption: C
May 4, 2025

Correct answer is C.