Question

Difficulty: MediumDeploying and Configuring Managed Database Instances

A system administrator is deploying a managed Cloud SQL instance for an enterprise application. The security policy dictates that the database must communicate strictly within a custom Virtual Private Cloud (VPC) network named 'corp-vpc' and must not have a public IP address. Which TWO actions must be completed to deploy the Cloud SQL instance with private IP connectivity and no public IP?

  1. Create a private services access connection by allocating an IP address range and peering 'corp-vpc' with the Google services network.Answer
  2. Include the '--network=corp-vpc' and '--no-assign-ip' flags when executing the 'gcloud sql instances create' command.Answer
  3. C
    Pass the '--authorized-networks=0.0.0.0/0' flag in the 'gcloud sql instances create' command to restrict access to internal VPC subnets.
  4. D
    Use the '--private-ip-only' flag and set '--zone=all' when executing the 'gcloud sql instances create' command.

Answer

The correct configuration requires establishing a private services access connection between 'corp-vpc' and Google services, and deploying the instance using the 'gcloud sql instances create' command with the '--network=corp-vpc' and '--no-assign-ip' flags.
Deploying a Cloud SQL instance with private IP connectivity requires establishing Private Service Access by peering the custom VPC with Google services, and running the deployment command with '--network' set to the VPC name alongside '--no-assign-ip' to prevent public IP creation.

Step-by-Step Solution

1
Configure Private Service Access
Allocates an IP address range in 'corp-vpc' and establishes VPC peering with Google managed services.
Cloud SQL instances reside in a Google-managed VPC, so private IP communication requires Private Service Access VPC peering.
2
Execute the instance creation command with appropriate network flags
Deploys the Cloud SQL instance with an internal IP address inside the peered range and prevents public IPv4 allocation.
The '--network=corp-vpc' flag connects the instance to the private network, and '--no-assign-ip' prevents public IP address assignment.

Key Concept

Provisioning Cloud SQL instances with Private IP and disabling Public IP via gcloud CLI and Private Service Access
Estimated Time:1m 30s
Rate this question