You will run an app on a Windows Compute Engine VM that connects to Cloud SQL via the Cloud SQL Auth Proxy. You created a custom service account and want least-privilege access. What next?
Choose an answer
Tap an option to check your answer.
Correct answer: Create and assign a custom IAM role containing cloudsql.instances.connect to the custom service account, and start the Cloud SQL Auth Proxy using the instance connection name..
Why this is the answer
The correct answer ensures least-privilege access by creating a custom IAM role with only the cloudsql.instances.connect permission. This is the minimum permission required for the Cloud SQL Auth Proxy to establish a connection. Starting the proxy with the instance connection name is the standard method for connecting to Cloud SQL. Granting roles/cloudsql.client is a valid option for the Cloud SQL Auth Proxy, but the question specifically asks for least-privilege access, and a custom role with only cloudsql.instances.connect is more restrictive than the predefined cloudsql.client role, which includes additional permissions. The --unix-socket option is typically used for Linux environments, not Windows, and isn't directly related to the IAM permissions. roles/cloudsql.editor grants broad permissions, including modifying Cloud SQL instances, which violates the principle of least privilege for a connection proxy. roles/cloudsql.viewer only allows viewing Cloud SQL instances and does not grant permission to connect, so the proxy would fail.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed