Soru

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

What is the correct sequence of operational steps to deploy a custom Virtual Private Cloud (VPC) network, provision a regional subnet, deploy a VM instance into that subnet, and enforce ingress firewall rules targeting the instance?

  1. 1Create a custom mode VPC network using `gcloud compute networks create --subnet-mode=custom`.
  2. 2Provision a regional subnet within the network using `gcloud compute networks subnets create`.
  3. 3Deploy a Compute Engine instance attached to the subnet and assign a target network tag.
  4. 4Create an ingress firewall rule using `gcloud compute firewall-rules create` specifying `--target-tags`.

Cevap

The correct sequence begins with creating the custom mode VPC network, followed by defining a regional subnet, deploying the VM instance with a target network tag inside that subnet, and finally creating an ingress firewall rule matching the target tag.
In Google Cloud, resource creation follows a strict logical dependency chain. A custom VPC network must be created first because subnets depend on a parent network. Once the custom network exists, a regional subnet must be created to provide IP address space. A VM instance can then be provisioned within that subnet with appropriate target network tags. Finally, an ingress firewall rule is created to target those tags and permit incoming network traffic.

Adım Adım Çözüm

1
Create the parent custom-mode VPC network.
A VPC network resource is created without any automatic default subnets.
Subnets require a parent VPC network resource to exist first.
2
Create a regional subnet inside the new VPC network.
A subnet IP range is allocated in the specified GCP region.
Compute instances in custom VPC networks require an existing regional subnet for primary network interfaces.
3
Provision a VM instance in the subnet and apply target network tags.
The VM instance starts with an IP address from the subnet and carries the network tag.
Target tags on instances allow fine-grained firewall rule association.
4
Create an ingress firewall rule referencing the target network tag.
Traffic matching allowed ports and protocols reaches the tagged VM instance.
Firewall rules govern network access to instances filtered by target network tags.

Anahtar Kavram

Deployment lifecycle order for custom mode VPC networks, subnets, VM instances, and firewall rules in Google Cloud.
Bu soruyu puanla