0
0
GCPcloud~10 mins

Subnet modes (auto, custom) in GCP - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Subnet modes (auto, custom)
Start VPC Creation
Choose Subnet Mode
Auto Mode
System creates
default subnets
Ready to use
Deploy VPC
When creating a VPC, you pick a subnet mode: auto creates default subnets automatically, custom requires you to create subnets yourself before use.
Execution Sample
GCP
gcloud compute networks create my-vpc --subnet-mode=auto

# vs

gcloud compute networks create my-vpc --subnet-mode=custom

gcloud compute networks subnets create my-subnet --network=my-vpc --region=us-central1 --range=10.0.0.0/24
Shows creating a VPC with auto mode (default subnets created) vs custom mode (user creates subnets manually).
Process Table
StepActionSubnet ModeSubnets CreatedResult
1Create VPC with --subnet-mode=autoautoDefault subnets in all regionsVPC ready with subnets
2Create VPC with --subnet-mode=customcustomNo subnets createdVPC ready but no subnets
3Create subnet manually in custom VPCcustomUser-defined subnet in specified regionSubnet ready for use
4Try to deploy VM in custom VPC without subnetcustomNo subnetDeployment fails - no subnet
5Deploy VM in auto VPCautoUses default subnetDeployment succeeds
💡 Execution stops after VPC and subnets are created and ready for resource deployment.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5
VPC StateNoneCreated with default subnetsCreated without subnetsCreated with user subnetNo subnets - deployment failsCreated with default subnets
SubnetsNoneDefault subnets presentNoneOne user subnet createdNoneDefault subnets present
Deployment StatusNoneNot startedNot startedNot startedFails - no subnetSucceeds - uses default subnet
Key Moments - 2 Insights
Why does deployment fail in custom mode before creating subnets?
Because in custom mode, no subnets exist by default (see execution_table step 4). You must create subnets manually before deploying resources.
Are subnets automatically created in custom mode?
No, subnets are only automatically created in auto mode (execution_table step 1). Custom mode requires manual subnet creation (step 3).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what subnets exist immediately after creating a VPC with --subnet-mode=custom?
ANo subnets
BDefault subnets in all regions
COne subnet in us-central1
DSubnets created only in us-east1
💡 Hint
Check execution_table row 2 under 'Subnets Created'
At which step does the deployment fail due to missing subnet?
AStep 2
BStep 4
CStep 3
DStep 5
💡 Hint
Look at execution_table row 4 under 'Result'
If you want subnets created automatically, which subnet mode should you choose?
Acustom
Bmanual
Cauto
Ddynamic
💡 Hint
Refer to concept_flow and execution_table step 1
Concept Snapshot
Subnet modes in GCP VPC:
- auto: system creates default subnets in all regions automatically
- custom: user creates subnets manually before use
- auto mode is quick for simple setups
- custom mode gives control over subnet ranges and regions
- resources need subnets to deploy; no subnets means deployment fails
Full Transcript
When you create a Virtual Private Cloud (VPC) network in Google Cloud Platform, you must choose a subnet mode. The two main modes are auto and custom. In auto mode, Google Cloud automatically creates default subnets in all regions for you. This means you can start deploying resources right away. In custom mode, no subnets are created automatically. You must create subnets yourself in the regions you want. If you try to deploy resources without creating subnets in custom mode, deployment will fail. Auto mode is easier for beginners or simple projects. Custom mode is better when you want full control over subnet IP ranges and locations. Always remember that subnets are required for resources to connect inside the VPC.