
Answer-first summary for fast verification
Answer: Enable private IP for the Cloud SQL instance.
Enabling private IP for the Cloud SQL instance allows the Compute Engine instances to connect to the Cloud SQL instance through the internal network, eliminating the need to whitelist IP addresses. This is the most efficient and secure method for connecting Compute Engine instances to a Cloud SQL instance within the same project without exposing the database to the public internet or managing IP whitelists. Options B, C, and D either do not address the requirement of avoiding IP whitelisting or introduce unnecessary complexity.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you enable Compute Engine virtual machine instances to connect to a Cloud SQL instance without whitelisting their IP addresses during a MySQL database migration to Google Cloud SQL?
A
Enable private IP for the Cloud SQL instance.
B
Whitelist a project to access Cloud SQL, and add Compute Engine instances in the whitelisted project.
C
Create a role in Cloud SQL that allows access to the database from external instances, and assign the Compute Engine instances to that role.
D
Create a CloudSQL instance on one project. Create Compute engine instances in a different project. Create a VPN between these two projects to allow internal access to CloudSQL.
No comments yet.