Google Cloud Associate Cloud Engineer — Question 40

You have a Linux VM that must connect to Cloud SQL. You created a service account with the appropriate access rights. You want to make sure that the VM uses this service account instead of the default Compute Engine service account. What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because specifying the service account during the VM creation process ensures that the VM uses the intended account for authentication. Options B, C, and D are incorrect as they involve downloading the JSON key and do not set the service account directly for the VM, which is necessary for proper access to Cloud SQL.