Soru

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

A cloud engineer needs to deploy a custom Virtual Private Cloud (VPC) environment in Google Cloud to host a secure internal application service. Arrange the following deployment steps in the correct logical sequence required to provision the infrastructure, set up IP addressing, enforce access security, and instantiate the workload.

  1. 1Create a custom-mode VPC network named `prod-vpc` with automatic subnet creation disabled using `gcloud compute networks create prod-vpc --subnet-mode=custom`.
  2. 2Provision a subnet named `backend-subnet` in region `us-east4` assigned to `prod-vpc` with primary IP range `10.240.10.0/24` using `gcloud compute networks subnets create`.
  3. 3Configure an ingress firewall rule `allow-backend-internal` in `prod-vpc` permitting TCP traffic on port 8443 targeting network tag `backend-app` using `gcloud compute firewall-rules create`.
  4. 4Launch a Compute Engine instance named `backend-vm-1` in zone `us-east4-a`, specifying `--subnet=backend-subnet` and `--tags=backend-app` using `gcloud compute instances create`.

Cevap

The correct order of steps is: 1) Create the custom-mode VPC network, 2) Provision the custom subnet within the network and region, 3) Configure the ingress firewall rule targeting the specific network tag, and 4) Launch the Compute Engine instance attached to the subnet with the designated network tag.
The deployment sequence follows infrastructure dependency requirements in GCP: top-level VPC networks must be created first, followed by regional subnets within that VPC. Firewall rules belong to the VPC network and reference target network tags. Compute instances are created last because they reference both the subnet (for IP configuration) and network tags (for firewall rule binding).

Adım Adım Çözüm

1
Create custom VPC network
The top-level container network `prod-vpc` is created without default subnets.
GCP resource hierarchy requires a parent VPC network to exist before subnets or firewall rules can be attached.
2
Provision custom regional subnet
`backend-subnet` is created inside `prod-vpc` with primary CIDR `10.240.10.0/24` in `us-east4`.
Compute instances require a regional subnet within the VPC to allocate network interface internal IP addresses.
3
Create firewall rule with target tags
Ingress firewall rule `allow-backend-internal` is established in `prod-vpc` bound to tag `backend-app`.
Defining network security controls prior to instance creation enforces zero-trust best practices and prevents unauthorized exposure during boot.
4
Deploy VM instance with subnet binding and network tags
Instance `backend-vm-1` is launched in `us-east4-a` connected to `backend-subnet` with tag `backend-app`.
The instance depends on the existing subnet for IP assignment and inherits ingress permissions via its applied network tag.

Anahtar Kavram

Dependency ordering for GCP VPC custom networking, regional subnet allocation, tag-based firewall policies, and VM provisioning.
Tahmini Süre:2m 0s
Bu soruyu puanla