Cloud basicsLesson 2 of 17
How a Request Travels Inside a VPC
A user visits an online store running in the cloud. The request enters your private network in the cloud (a VPC) and passes several gates. Follow what is exposed to the internet and what is hidden, and what each gate lets through or blocks. The basic flow of a request inside a data center comes first in When You Type an Address.
Passing throughInternet
Security group verdict-
Exposed to internetLB address
RequestResponse / reportAppears in a later step
What you will learn
- What a VPC, a subnet and an internet gateway each are
- What separates public and private subnets
- How security groups open doors with allow rules only
- Responses to allowed requests go out automatically (stateful)
- How private servers get updates through a NAT gateway
Names for each gate (AWS · Azure · GCP)
| Concept | AWS | Azure | GCP |
|---|---|---|---|
| Your private network | VPC | Virtual Network (VNet) | VPC network |
| Internet door | Internet Gateway | Default internet route, no separate resource | Default internet gateway route |
| Outbound-only address translation | NAT Gateway | NAT Gateway | Cloud NAT |
| Stateful firewall in front of servers | Security Group | Network Security Group (NSG) | VPC firewall rules |
| Load balancer | Elastic Load Balancing | Load Balancer · Application Gateway | Cloud Load Balancing |
Try it yourself
aws ec2 describe-vpcs --query 'Vpcs[].[VpcId,CidrBlock]' --output table # VPCs (AWS example)
aws ec2 describe-subnets --filters Name=vpc-id,Values=<vpc-id> --query 'Subnets[].[SubnetId,AvailabilityZone,CidrBlock]' --output table # Subnets
aws ec2 describe-route-tables --filters Name=vpc-id,Values=<vpc-id> --query 'RouteTables[].Routes[].[DestinationCidrBlock,GatewayId,NatGatewayId]' --output table # igw route = public, nat route = private
aws ec2 describe-security-groups --group-ids <sg-id> --query 'SecurityGroups[].IpPermissions' # Inbound allow rules
aws ec2 describe-nat-gateways --filter Name=vpc-id,Values=<vpc-id> # NAT gateway for the way out
Check yourself
Further reading: What is Amazon VPC? (AWS) · Security groups (AWS) · Service (Kubernetes docs) · When You Type an Address