A cloud engineer needs to deploy a custom enterprise environment in Google Cloud using the Google Cloud CLI (`gcloud`). The environment requires a custom VPC network, a dedicated subnet in `us-central1`, a restrictive ingress firewall rule for web application traffic, and a Compute Engine VM instance. Arrange the operational steps in the correct chronological sequence required to provision this infrastructure successfully.
- 1Create the custom-mode VPC network 'prod-vpc' using 'gcloud compute networks create prod-vpc --subnet-mode=custom'.
- 2Create the subnet 'prod-app-subnet' inside 'prod-vpc' using 'gcloud compute networks subnets create prod-app-subnet --network=prod-vpc --region=us-central1 --range=10.10.1.0/24'.
- 3Create the ingress firewall rule 'allow-app-ingress' on 'prod-vpc' targeting network tag 'app-server' on TCP port 8080 using 'gcloud compute firewall-rules create allow-app-ingress --network=prod-vpc --allow=tcp:8080 --target-tags=app-server'.
- 4Deploy the Compute Engine VM instance 'app-vm-1' in 'us-central1' using 'gcloud compute instances create app-vm-1 --zone=us-central1-a --subnet=prod-app-subnet --tags=app-server'.
Cevap
The correct sequence of operations is: (1) Create the custom-mode VPC network 'prod-vpc', (2) Create the custom subnet 'prod-app-subnet' within the VPC, (3) Create the ingress firewall rule 'allow-app-ingress' targeting tag 'app-server', and (4) Deploy the Compute Engine VM instance 'app-vm-1' attached to 'prod-app-subnet' with tag 'app-server'.
In Google Cloud, infrastructure provisioning follows a strict dependency hierarchy. First, the custom VPC network container must be created (`gcloud compute networks create --subnet-mode=custom`). Second, regional subnets are created inside that VPC (`gcloud compute networks subnets create`). Third, firewall rules are established on the VPC network specifying target network tags (`gcloud compute firewall-rules create`). Finally, Compute Engine VM instances are deployed into the designated subnet and tagged appropriately (`gcloud compute instances create --subnet ... --tags ...`) so that network routing and firewall policies apply immediately.
Adım Adım Çözüm
Anahtar Kavram
Deployment dependency order for GCP VPC networks, subnets, firewall rules, and compute instances.