- A
Use the Cloud SQL Proxy on the VM and a public IP for the Cloud SQL instance.
Why wrong: Using a public IP defeats the purpose of not exposing the instance.
- B
Configure VPC peering between the VM's subnet and the Cloud SQL instance's VPC.
Why wrong: VPC peering provides network connectivity but does not authorize the VM to access Cloud SQL.
- C
Create a private IP for the Cloud SQL instance using Private Services Access, grant the VM's service account the Cloud SQL Client role, and ensure the VM is in the same VPC.
This setup provides private connectivity and IAM authorization.
- D
Add a firewall rule allowing ingress from the VM's IP to the Cloud SQL instance's internal IP.
Why wrong: Cloud SQL IAM controls access; firewall rules are not directly applicable to Cloud SQL access.
Quick Answer
The correct answer is to create a private IP for the Cloud SQL instance using Private Services Access, grant the VM's service account the Cloud SQL Client role, and ensure the VM is in the same VPC. This configuration works because Private Services Access establishes a private, internal connection between your VPC and a Google-managed service tenant, allowing the Cloud SQL instance to receive traffic over a private IP without any internet exposure. On the Google Professional Cloud Security Engineer exam, this question tests your understanding of how to combine networking and IAM for least-privilege access—a common trap is assuming VPC peering alone is sufficient, but it does not grant the necessary cloudsql.client IAM role. Remember the key pairing: private IP from Private Services Access plus the Cloud SQL Client role on the VM’s service account. For a quick memory tip, think “PSA + Client = Private Access.”
PCSE Practice Question: Configuring access within a cloud solution environment
This PCSE practice question tests your understanding of configuring access within a cloud solution environment. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A company wants to allow a Compute Engine VM to access a Cloud SQL instance without exposing the SQL instance to the internet. The VM is in the same VPC but different subnet. Which configuration is required?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Create a private IP for the Cloud SQL instance using Private Services Access, grant the VM's service account the Cloud SQL Client role, and ensure the VM is in the same VPC.
Option C is correct because Cloud SQL requires a private services access connection and the VM must have the cloudsql.client role to connect. Option A is wrong because the Cloud SQL Proxy can be used but requires a public IP if not within the VPC. Option B is wrong because VPC peering alone does not grant IAM permissions. Option D is wrong because a firewall rule is not sufficient without IAM.
Key principle: Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the Cloud SQL Proxy on the VM and a public IP for the Cloud SQL instance.
Why it's wrong here
Using a public IP defeats the purpose of not exposing the instance.
- ✗
Configure VPC peering between the VM's subnet and the Cloud SQL instance's VPC.
Why it's wrong here
VPC peering provides network connectivity but does not authorize the VM to access Cloud SQL.
- ✓
Create a private IP for the Cloud SQL instance using Private Services Access, grant the VM's service account the Cloud SQL Client role, and ensure the VM is in the same VPC.
Why this is correct
This setup provides private connectivity and IAM authorization.
Related concept
CIDR notation defines the prefix length.
- ✗
Add a firewall rule allowing ingress from the VM's IP to the Cloud SQL instance's internal IP.
Why it's wrong here
Cloud SQL IAM controls access; firewall rules are not directly applicable to Cloud SQL access.
Common exam traps
Common exam trap: usable hosts are not the same as total addresses
Subnetting questions often tempt you into counting all addresses. In normal IPv4 subnets, the network and broadcast addresses are not usable host addresses.
Detailed technical explanation
How to think about this question
Subnetting questions test whether you can identify the network, broadcast address, usable range, mask and correct subnet. Slow down enough to calculate the block size correctly.
KKey Concepts to Remember
- CIDR notation defines the prefix length.
- Block size helps identify subnet boundaries.
- Network and broadcast addresses are not usable hosts in normal IPv4 subnets.
- The required host count determines the smallest suitable subnet.
TExam Day Tips
- Write the block size before choosing the subnet.
- Check whether the question asks for hosts, subnets or a specific address range.
- Do not confuse /24, /25, /26 and /27 host counts.
Key takeaway
Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related PCSE subnetting questions on CIDR, address ranges, and subnet selection.
- →
Configuring access within a cloud solution environment — study guide chapter
Learn the concepts, then practise the questions
- →
Configuring access within a cloud solution environment practice questions
Targeted practice on this topic area only
- →
All PCSE questions
500 questions across all exam domains
- →
Google Professional Cloud Security Engineer study guide
Full concept coverage aligned to exam objectives
- →
PCSE practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related PCSE practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Configuring network security practice questions
Practise PCSE questions linked to Configuring network security.
Configuring access within a cloud solution environment practice questions
Practise PCSE questions linked to Configuring access within a cloud solution environment.
Ensuring data protection practice questions
Practise PCSE questions linked to Ensuring data protection.
Managing operations in a cloud solution environment practice questions
Practise PCSE questions linked to Managing operations in a cloud solution environment.
Supporting compliance requirements practice questions
Practise PCSE questions linked to Supporting compliance requirements.
PCSE fundamentals practice questions
Practise PCSE questions linked to PCSE fundamentals.
PCSE scenario practice questions
Practise PCSE questions linked to PCSE scenario.
PCSE troubleshooting practice questions
Practise PCSE questions linked to PCSE troubleshooting.
Practice this exam
Start a free PCSE practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this PCSE question test?
Configuring access within a cloud solution environment — This question tests Configuring access within a cloud solution environment — CIDR notation defines the prefix length..
What is the correct answer to this question?
The correct answer is: Create a private IP for the Cloud SQL instance using Private Services Access, grant the VM's service account the Cloud SQL Client role, and ensure the VM is in the same VPC. — Option C is correct because Cloud SQL requires a private services access connection and the VM must have the cloudsql.client role to connect. Option A is wrong because the Cloud SQL Proxy can be used but requires a public IP if not within the VPC. Option B is wrong because VPC peering alone does not grant IAM permissions. Option D is wrong because a firewall rule is not sufficient without IAM.
What should I do if I get this PCSE question wrong?
Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related PCSE subnetting questions on CIDR, address ranges, and subnet selection.
What is the key concept behind this question?
CIDR notation defines the prefix length.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Keep practising
More PCSE practice questions
- Match each IAM role to its typical use case.
- Match each encryption scope to its description.
- Match each CVE or security concept to its description.
- Match each Google Cloud logging/monitoring term to its definition.
- Drag and drop the steps to rotate a customer-managed encryption key (CMEK) in Cloud KMS in the correct order.
- Drag and drop the steps to configure a Cloud NAT for private VM instances in the correct order.
Last reviewed: Jun 24, 2026
This PCSE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCSE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.