VPC and subnet plan
Add public, private and service subnets in one workspace.
NAMEIPV4 CIDRAZ SUFFIXTYPE
aws ec2 create-vpc --cidr-block 10.0.0.0/16 --region eu-west-1 --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=main-vpc}]'
# Save the returned VpcId as VPC_ID
aws ec2 create-subnet --vpc-id $VPC_ID --cidr-block 10.0.1.0/24 --availability-zone eu-west-1a --region eu-west-1 --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=public-a},{Key=Type,Value=public}]'
aws ec2 create-subnet --vpc-id $VPC_ID --cidr-block 10.0.10.0/24 --availability-zone eu-west-1a --region eu-west-1 --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=private-a},{Key=Type,Value=private}]'
aws ec2 create-subnet --vpc-id $VPC_ID --cidr-block 10.0.20.0/24 --availability-zone eu-west-1a --region eu-west-1 --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=database-a},{Key=Type,Value=private}]'Review before deploymentConfirm that subnet CIDRs are inside the parent range and do not overlap. Route tables, NAT, internet access and subnet associations remain separate decisions.