A cloud engineer is provisioning a custom-mode Virtual Private Cloud (VPC) network named `production-vpc` using the `gcloud` CLI. A new subnet named `data-subnet` must be deployed in `us-central1` with the IP range . Virtual machine instances deployed in this subnet will not have external IP addresses but must be able to communicate with Google Cloud APIs and services. Furthermore, an ingress firewall rule named `allow-internal-pg` must be configured to allow TCP port 5432 traffic from to instances tagged `postgres-db`, overriding a baseline rule with priority 1000 that denies all ingress traffic to database nodes. Which two `gcloud` CLI commands or flags are required to complete this deployment correctly? (Select TWO.)
- Include `--enable-private-ip-google-access` when creating `data-subnet` using `gcloud compute networks subnets create` to allow VMs without external IPs to reach Google APIs.Answer
- Specify `--priority=500` when executing `gcloud compute firewall-rules create allow-internal-pg` to ensure the allow rule evaluates before the priority 1000 deny rule.Answer
- CSpecify `--priority=2500` when executing `gcloud compute firewall-rules create allow-internal-pg` to give the allow rule higher precedence than priority 1000.
- DPass `--enable-private-ip-google-access` to `gcloud compute networks create production-vpc` to enable Google service access globally across all subnets.
Answer
The deployment requires configuring `--enable-private-ip-google-access` at the subnet level when creating the subnet and using a priority number lower than 1000 (such as 500) for the ingress firewall rule to override the existing baseline rule.
Private Google Access is configured on individual subnets using `gcloud compute networks subnets create` with the `--enable-private-ip-google-access` flag to allow VMs with only internal IP addresses to communicate with Google services. Additionally, firewall rules in GCP process in order of priority from lowest numerical integer to highest. Therefore, to override an existing rule with priority 1000, setting `--priority=500` ensures that the allow rule takes precedence.
Step-by-Step Solution
Key Concept
VPC Subnet Private Google Access configuration and Firewall Rule Priority Precedence
Estimated Time:1m 30s