AWS Builder Center
Day 5: Networking, Content Delivery and Serverless Architecture

Day 5: Networking, Content Delivery and Serverless Architecture

Exam domain covered today: Domain 3, Cloud Technology and Services (34%), with security links to Domain 2.

What you will learn today

  • Amazon VPC, subnets, route tables, Internet Gateway, NAT Gateway
  • Security Groups and Network ACLs
  • Route 53, CloudFront, Global Accelerator, and API Gateway
  • VPN, Direct Connect, Transit Gateway, and PrivateLink
  • Serverless architecture and application integration (SQS, SNS, EventBridge, Step Functions)

1. Amazon VPC (Virtual Private Cloud)

A VPC is your own logically isolated virtual network in an AWS Region. You choose IP ranges, subnets, routing, and gateways.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
AWS Region
+------------------------------ VPC 10.0.0.0/16 ------------------------------+
| |
| AZ-a AZ-b |
| +------------------------+ +------------------------+ |
| | PUBLIC subnet 10.0.1.0 | | PUBLIC subnet 10.0.2.0 | |
| | [Web server] [NAT GW] | | [Web server] | |
| +-----------+------------+ +-----------+------------+ |
| +------------------------+ +------------------------+ |
| | PRIVATE subnet 10.0.3.0| | PRIVATE subnet 10.0.4.0| |
| | [App] [Database] | | [App] [Database] | |
| +------------------------+ +------------------------+ |
| |
+----------------------------------+--------------------------------------------+
|
[ Internet Gateway ]
|
Internet
ComponentWhat it doesKey facts
VPCIsolated virtual networkSpans all AZs in a Region; defined by a CIDR block (for example 10.0.0.0/16)
SubnetA range of IPs inside one AZPublic subnet has a route to an Internet Gateway; private subnet does not
Route tableRules (routes) that decide where traffic goesEach subnet is associated with a route table
Internet Gateway (IGW)Connects the VPC to the internetHorizontally scaled, highly available, no charge itself
NAT GatewayLets private instances reach the internet outbound only (for updates)Lives in a public subnet; managed by AWS; hourly and data processing charges
Elastic IPStatic public IPv4 addressCharged when not attached (and for public IPv4 addresses generally)
Default VPCVPC created in every Region for your accountHas public subnets so you can launch quickly
VPC Flow LogsCapture traffic information for network interfacesTroubleshooting, security analysis
VPC PeeringPrivate connection between two VPCs (same or different Region/account)Not transitive (A-B and B-C does not give A-C)
VPC EndpointsPrivate access to AWS services without using the internetGateway endpoints (S3 and DynamoDB, free) and Interface endpoints (powered by PrivateLink, hourly charge)
AWS PrivateLinkPrivate connectivity to services across VPCs and accounts, traffic stays on the AWS network"Expose or consume a service privately"
AWS Transit GatewayCentral hub connecting many VPCs and on-premises networksReplaces complex peering meshes

Public vs private subnet

Public subnetPrivate subnet
Route to IGWYesNo
Directly reachable from internetYes (if it has a public IP and security rules allow)No
Typical resourcesWeb servers, load balancers, NAT GatewayApplication servers, databases
Internet access for updatesThrough IGWThrough NAT Gateway (outbound only)
Analogy: The VPC is your gated community. A public subnet is the shopfront near the main gate. A private subnet is the residential block inside. The Internet Gateway is the main gate, and the NAT Gateway is a courier who goes out to fetch things for residents without letting strangers in.

Flow of traffic to a web application

1
2
User --> Route 53 (DNS) --> CloudFront --> Load Balancer (public subnet)
--> EC2 web/app (private subnet) --> RDS database (private subnet)

2. Security Groups vs Network ACLs (classic exam question)

1
2
3
4
5
Internet --> [ Internet Gateway ] --> [ Network ACL ] (subnet boundary)
|
[ Security Group ] (instance boundary)
|
[ EC2 ]
FeatureSecurity GroupNetwork ACL (NACL)
Works atInstance (network interface) levelSubnet level
StateStateful: return traffic is automatically allowedStateless: you must allow inbound and outbound explicitly
Rule typesAllow rules onlyAllow and Deny rules
Rule evaluationAll rules evaluatedRules evaluated in number order, first match wins
Default (new)Denies all inbound, allows all outboundDefault NACL allows all in and out
Applies toOnly instances it is associated withAll instances in the subnet
Use forPrimary instance firewallExtra layer, block specific IPs
Analogy: The NACL is the security gate at the apartment complex entrance; it can ban specific people. The security group is the lock on your own apartment door; it only lists who may enter, and anyone you let in can leave freely.
Exam clues: "Block a specific IP address" = NACL. "Stateful" = Security group. "Subnet level" = NACL. "Instance level" = Security group.

3. Connecting on-premises networks to AWS

1
2
3
4
5
6
7
Corporate data center
|
|-- Site-to-Site VPN ---- encrypted tunnel over the PUBLIC internet ---> VPC
|
|-- AWS Direct Connect -- dedicated PRIVATE fiber line (not internet) -> VPC
|
Individual remote user ---- AWS Client VPN ------------------------------> VPC
OptionPathSpeed and consistencySetup timeCostBest for
AWS Site-to-Site VPNEncrypted IPsec tunnel over the internetVariable (internet-dependent)MinutesLowQuick, secure connection, backup for Direct Connect
AWS Direct ConnectDedicated private network connection from your site to AWSConsistent, low latency, high bandwidth (1, 10, 100 Gbps)WeeksHigherLarge, steady data transfer, hybrid workloads
AWS Client VPNIndividual users connect with a VPN clientInternet-dependentMinutesPer connectionRemote workforce
AWS Transit GatewayHub for VPCs, VPNs, and Direct ConnectHighModerateHourly + dataMany networks
Exam clues: "Private, dedicated, consistent bandwidth, not over the internet" = Direct Connect. "Quick, encrypted over the internet" = Site-to-Site VPN. Direct Connect is not encrypted by default; combine it with a VPN if needed.

4. DNS and content delivery

Amazon Route 53

A highly available and scalable DNS service. It translates names (example.com) to IP addresses, registers domains, and performs health checks.
Routing policyBehaviorUse case
SimpleOne record, one answerSingle resource
WeightedSplit traffic by percentageA/B testing, gradual rollouts
Latency-basedSend users to the lowest-latency RegionGlobal apps
FailoverPrimary and secondary with health checksDisaster recovery
GeolocationRoute by user locationLanguage, compliance
GeoproximityRoute by distance, with biasShift traffic between Regions
Multivalue answerReturn several healthy recordsBasic load distribution
Analogy: Route 53 is the phone book: you look up a name and get a number.

Amazon CloudFront (CDN)

CloudFront is a content delivery network that caches copies of your content at edge locations worldwide to cut latency.
1
2
3
4
User in Chennai --> nearest Edge Location (cache HIT? serve immediately)
| cache MISS
v
Origin (S3 bucket, ALB, EC2, custom server)
FeatureDetail
OriginsS3, ALB, EC2, API Gateway, any HTTP server
BenefitsLower latency, reduced load on origin, DDoS protection with Shield Standard, AWS WAF integration
SecurityHTTPS, signed URLs/cookies, Origin Access Control to keep S3 private
CachingControlled by TTL; content cached at edge until expiry
PricingPay for data transfer out and requests

AWS Global Accelerator

CloudFrontGlobal Accelerator
Caches contentYesNo
Best forStatic and dynamic web contentTCP/UDP apps, gaming, VoIP, IoT; fast failover
How it helpsServes from edge cacheRoutes users over the AWS global network to the best endpoint via static anycast IPs

Elastic Load Balancing (recap from Day 3)

ALBNLBGWLB
HTTP/HTTPS, Layer 7TCP/UDP, Layer 4, static IPThird-party appliances

5. Amazon API Gateway

A fully managed service to create, publish, secure, monitor, and scale APIs (REST, HTTP, WebSocket).
1
2
3
Mobile / web client --> API Gateway --> Lambda function --> DynamoDB
(auth, throttling,
caching, monitoring)
FeatureDetail
Front door forLambda, EC2, other AWS services, on-premises apps
SecurityIAM, Amazon Cognito, Lambda authorizers, API keys
ControlThrottling, usage plans, caching, request validation
PricingPay per API call and data transferred; no minimum fee

6. Serverless architecture

Serverless means you do not provision, patch, or scale servers. AWS runs the infrastructure, scales automatically, and you pay only for actual use.
Serverless characteristicMeaning
No server managementNo OS patching or capacity planning
Automatic scalingFrom zero to peak and back
Pay for valueBilled per request, duration, or data processed
Built-in high availabilityMulti-AZ by default
LayerServerless services
ComputeAWS Lambda, AWS Fargate
APIAmazon API Gateway, AWS AppSync (GraphQL)
StorageAmazon S3, Amazon EFS
DatabaseAmazon DynamoDB, Aurora Serverless
MessagingAmazon SQS, Amazon SNS
Orchestration and eventsAWS Step Functions, Amazon EventBridge
User identityAmazon Cognito
AnalyticsAmazon Athena, AWS Glue, Kinesis Data Firehose

Typical serverless web application

1
2
3
4
5
6
7
8
9
10
11
12
13
Users
|
v
CloudFront (CDN) ----> S3 (static website: HTML, CSS, JS)
|
v
API Gateway <--- Cognito (sign-up / sign-in)
|
v
Lambda (business logic)
|
+--> DynamoDB (data)
+--> SNS / SQS (notifications, queues)

Application integration (decoupling) services

ServicePatternHow it worksExam hook
Amazon SQS (Simple Queue Service)Queue (pull)Producers send messages; consumers poll and process; messages wait safely"Decouple", "buffer", "queue"
Amazon SNS (Simple Notification Service)Pub/sub (push)One message published to a topic is pushed to many subscribers (email, SMS, Lambda, SQS)"Notifications", "fan-out", "email/SMS"
Amazon EventBridgeEvent busRoutes events from AWS services, SaaS apps, and schedules to targets using rules"React to events", "cron schedules"
AWS Step FunctionsWorkflowOrchestrates multiple services in a visual state machine"Coordinate steps", "workflow"
Amazon MQManaged message brokerActiveMQ and RabbitMQ compatible"Migrate existing brokers"
AWS AppSyncGraphQL APIManaged GraphQL with real-time data"GraphQL"
SQS vs SNS
SQSSNS
ModelQueuePublish/subscribe
DeliveryConsumers pullService pushes to subscribers
Messages storedYes, until processedNo (delivered immediately)
RecipientsTypically one consumer groupMany subscribers
Analogy: SQS is a mailbox where messages wait until you pick them up. SNS is a loudspeaker announcing to everyone subscribed at the same moment.
Tight vs loose coupling
1
2
TIGHT: [Web] ------------> [Order service] (if Order service is down, Web fails)
LOOSE: [Web] --> [ SQS ] --> [Order service] (messages wait, nothing is lost)

7. Networking summary: which service for which job?

NeedService
Isolated private network in AWSVPC
Give private servers outbound-only internetNAT Gateway
Connect VPC to the internetInternet Gateway
Firewall at instance levelSecurity group
Firewall at subnet level, with deny rulesNetwork ACL
Translate domain names, route traffic, health checkRoute 53
Cache content at the edgeCloudFront
Improve performance of non-HTTP global appsGlobal Accelerator
Distribute traffic among serversElastic Load Balancing
Encrypted tunnel over internet to on-premisesSite-to-Site VPN
Dedicated private line to on-premisesDirect Connect
Connect many VPCs and sites in a hubTransit Gateway
Private connection between two VPCsVPC Peering
Access S3 privately without internetVPC endpoint (gateway)
Private access to a service across VPCs/accountsPrivateLink
Build and manage APIsAPI Gateway
1
2
3
4
5
6
7
Networking decision flow
Need to connect to on-premises?
|-- quickly / low cost / over the internet ----> Site-to-Site VPN
|-- steady, high bandwidth, consistent ---------> Direct Connect
|-- many VPCs and networks together -----------> Transit Gateway
Need two VPCs to talk privately? -----------------> VPC Peering (or Transit Gateway)
Need to reach S3/DynamoDB without internet? ------> Gateway VPC endpoint

8. Exam traps for Day 5

TrapCorrect thinking
Security groups can deny trafficThey have allow rules only
NACLs are statefulNACLs are stateless
NAT Gateway allows inbound internet connectionsIt allows outbound only for private subnets
VPC spans one AZA VPC spans a Region; a subnet is in one AZ
Direct Connect uses the internetIt is a dedicated private connection
VPC peering is transitiveIt is not transitive
CloudFront and Global Accelerator are the sameCloudFront caches; Global Accelerator does not
Route 53 only does DNSIt also registers domains and does health checks
SNS stores messages for later pickupThat is SQS; SNS pushes immediately
Serverless means no servers existServers exist, but AWS manages them

9. Key takeaways

  • VPC is your private network; public subnets route to an IGW, private subnets use a NAT Gateway for outbound access.
  • Security group = stateful, instance level, allow only. NACL = stateless, subnet level, allow and deny.
  • VPN = internet, quick. Direct Connect = dedicated, consistent.
  • Route 53 = DNS. CloudFront = CDN. API Gateway = APIs.
  • Serverless = Lambda, API Gateway, DynamoDB, S3, SQS, SNS, Step Functions, EventBridge.

10. Day 5 practice questions

#QuestionAnswer
1Which acts as a stateless firewall at the subnet level?Network ACL
2Which service provides a dedicated private connection between on-premises and AWS?AWS Direct Connect
3Which service delivers content with low latency using edge locations?Amazon CloudFront
4Which gateway lets private subnet instances reach the internet outbound only?NAT Gateway
5Which service creates and manages APIs in front of Lambda functions?Amazon API Gateway
6Which service translates domain names to IP addresses?Amazon Route 53
7Which Route 53 routing policy sends users to the Region with the lowest delay?Latency-based routing
8Which service connects many VPCs and on-premises networks through a central hub?AWS Transit Gateway
9Which service lets you access a service privately without traffic crossing the public internet?AWS PrivateLink (VPC endpoints)
10Which service decouples applications with a message queue?Amazon SQS
11Which service sends one message to many subscribers such as email and SMS?Amazon SNS
12Which service coordinates multiple AWS services into a visual workflow?AWS Step Functions
Up next on Day 6: AI/ML, Analytics, Monitoring and Governance.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article