Soru

Zorluk: OrtaDeploying Virtual Private Cloud (VPC) Networks, Subnets, and Firewall Rules

An infrastructure engineer needs to set up an isolated enterprise application environment in Google Cloud using the `gcloud` CLI. The setup requires creating a custom VPC network, provisioning a subnet with Private Google Access enabled, establishing an ingress firewall rule targeting a specific network tag, and launching a Compute Engine instance configured with that network tag.

In what order should the engineer execute these operational steps?

  1. 1Run `gcloud compute networks create corp-vpc --subnet-mode=custom` to create the custom VPC network.
  2. 2Run `gcloud compute networks subnets create corp-app-subnet --network=corp-vpc --region=us-east4 --range=10.150.0.0/24 --enable-private-ip-google-access` to create the subnet.
  3. 3Run `gcloud compute firewall-rules create allow-corp-https --network=corp-vpc --allow=tcp:443 --target-tags=web-frontend` to configure the firewall rule.
  4. 4Run `gcloud compute instances create web-server-1 --zone=us-east4-a --subnet=corp-app-subnet --tags=web-frontend` to launch the virtual machine.

Cevap

The correct sequence is: first create the custom VPC network, next create the subnet with Private Google Access enabled in that network, then create the ingress firewall rule with target tags on the network, and finally deploy the VM instance into the subnet with the matching network tag.
The correct order follows Google Cloud resource dependency requirements: the custom VPC network must be created first as the parent container, followed by creating the subnetwork within that network, establishing firewall rules attached to the network with target tags, and finally deploying the Compute Engine VM into the subnet with the matching target tag.

Adım Adım Çözüm

1
Create the custom VPC network
Network `corp-vpc` is created without auto-generated subnets.
VPC networks serve as the top-level container for subnets and firewall rules in Google Cloud.
2
Create the custom subnetwork
Subnet `corp-app-subnet` is created in region `us-east4` with Private Google Access enabled.
Subnets define regional IP address ranges within a parent VPC network.
3
Configure the ingress firewall rule
Firewall rule `allow-corp-https` is created targeting tag `web-frontend`.
Defining network firewall rules before VM instantiation ensures immediate enforcement of access controls upon instance launch.
4
Deploy the VM instance
Instance `web-server-1` is instantiated in `corp-app-subnet` with tag `web-frontend`.
VM instances depend on existing subnetworks and network tags for IP allocation and security rule association.

Anahtar Kavram

Deployment dependency order for Google Cloud VPC networks, subnets, firewall rules, and Compute Engine instances.
Bu soruyu puanla