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?
- 1Create a custom mode VPC network using `gcloud compute networks create --subnet-mode=custom`.
- 2Provision a regional subnet within the network using `gcloud compute networks subnets create`.
- 3Deploy a Compute Engine instance attached to the subnet and assign a target network tag.
- 4Create an ingress firewall rule using `gcloud compute firewall-rules create` specifying `--target-tags`.
Answer
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.
Step-by-Step Solution
Key Concept
Deployment lifecycle order for custom mode VPC networks, subnets, VM instances, and firewall rules in Google Cloud.