Lesson 23 of 36 · see all lessons
  1. Start here: cloud concepts (domain 1, 24%)

    1. 1. Start here: the exam, the plan and what you already know
    2. 2. What the cloud is: benefits, service models and deployment models
    3. 3. AWS global infrastructure: Regions, Availability Zones and edge locations
    4. 4. Cloud economics: what you pay for on-premises vs in the cloud
    5. 5. The AWS Well-Architected Framework: six pillars
    6. 6. Moving to AWS: the Cloud Adoption Framework and migration strategies
  2. Security and identity (domain 2, 30%)

    1. 7. The shared responsibility model: who secures what
    2. 8. IAM basics: users, groups, roles and policies
    3. 9. Protecting the root user, MFA and credentials
    4. 10. Identity at scale: IAM Identity Center, federation and cross-account access
    5. 11. Encryption and keys: protecting data at rest and in transit
    6. 12. Threat protection: Shield, WAF, GuardDuty, Inspector and Security Hub
  3. Governance, ways of working and compute (domains 2 and 3)

    1. 13. Logging, auditing and compliance: CloudWatch, CloudTrail, Config and Artifact
    2. 14. Governing many accounts: Organizations, Control Tower and Service Catalog
    3. 15. Ways to use AWS: console, CLI, SDKs and infrastructure as code
    4. 16. Amazon EC2: virtual servers and instance types
    5. 17. Elasticity: Auto Scaling and Elastic Load Balancing
    6. 18. Containers and serverless: ECS, EKS, Fargate, Lambda and more
  4. Storage, databases and networking (domain 3, 34%)

    1. 19. Block and file storage: EBS, instance store, EFS and FSx
    2. 20. Amazon S3: buckets, storage classes and lifecycle policies
    3. 21. Hybrid storage, backup and disaster recovery
    4. 22. Databases: RDS, Aurora, DynamoDB, ElastiCache and more
    5. 23. Networking: VPCs, subnets, gateways and security layers
    6. 24. Connecting and delivering: Route 53, CloudFront, VPN and Direct Connect
  5. Analytics, AI, integration and more (domain 3)

    1. 25. Analytics services: Athena, Glue, Kinesis, Redshift and Quick
    2. 26. AI and machine learning services: SageMaker AI, Lex, Rekognition and Amazon Q
    3. 27. App integration and business apps: SQS, SNS, EventBridge, Connect and SES
    4. 28. Developer tools, end-user computing, Amplify and IoT
  6. Billing, pricing and support, then exam practice (domain 4, 12%)

    1. 29. Pricing models: On-Demand, Savings Plans, Reserved, Spot and Dedicated
    2. 30. Billing and cost tools: Budgets, Cost Explorer, Pricing Calculator and tags
    3. 31. AWS Support plans, Trusted Advisor and where to get help
    4. 32. Final review and exam day: every decision on one page
    5. 33. Mock exam 1
    6. 34. Mock exam 2 Exam Pack · $12
  7. Extra practice: mock exams 3 and 4

    1. 35. Mock exam 3 Exam Pack · $12
    2. 36. Mock exam 4 Exam Pack · $12
See the leaderboard

19 min

Networking: VPCs, subnets, gateways and security layers

Build a mental model of a VPC with public and private subnets, gateways, and security groups versus network ACLs.

By the end of this lesson you can

  • Name the parts of a VPC and what each one does
  • Explain what makes a subnet public or private
  • Choose between a security group and a network ACL
  • Recognize PrivateLink, VPC peering, Transit Gateway and Flow Logs

From earlier lessons · 1 of 2

A company's Amazon RDS database must keep running if one Availability Zone fails. Which RDS feature meets this requirement?

Pick one answer.

From earlier lessons · 2 of 2

Which AWS service automatically scans Amazon EC2 instances and container images for software vulnerabilities?

Pick one answer.

Cedar Lane Books' back-office room has one rule: shoppers see the website, never the orders database. A locked door and a cable do that today. On AWS there's no door to lock. So where does the database live, and what stops a stranger on the internet from reaching it?

[4]

Amazon VPC: your own network in a Region

Exam depth: know it cold.

Amazon VPC (Virtual Private Cloud) lets you launch AWS resources in a logically isolated virtual network that you define. It works like the network in your own data center, but on AWS hardware. Logically isolated means other customers' networks can't see it, even though the hardware is shared.

A VPC belongs to one Region. Inside it you create subnets in that Region's Availability Zones. Every account gets a ready-made default VPC in each Region.

Each VPC has an IP address range written in CIDR notation, such as 10.0.0.0/16. That's all the exam needs about CIDR.

[260][261][262]

Cedar Lane Books' VPC: one Region, two AZs, four subnetsRegion (Europe)VPC 10.0.0.0/16Availability Zone aAvailability Zone bPublic subnet aPrivate subnet aPublic subnet bPrivate subnet bA VPC spans the AZs of oneRegion.Each subnet sits in exactlyone AZ.

[263]

Subnets: public or private

Exam depth: know it cold.

A subnet is a slice of your VPC's IP range. Each subnet lives entirely in one Availability Zone. Put subnets in two or more AZs, and one AZ failing won't take your app down.

  • Public subnet: its route table has a direct route to an internet gateway. Resources with a public IP address can reach the internet and be reached from it.
  • Private subnet: no direct route to an internet gateway. To reach out to the internet, it needs a NAT gateway.

The name doesn't make a subnet public. The route does. AWS recommends private subnets for anything that doesn't need to face the internet, like databases.

[263]

A cloud practitioner is reviewing a VPC. Which setting makes a subnet a public subnet?

Pick one answer.

[263]

Internet gateway, NAT gateway, route tables and endpoints

Exam depth: know it cold.

ComponentWhat it does
Internet gatewayConnects the VPC to the internet, both ways. Highly available, and free.
NAT gatewayLets instances in a private subnet start connections out (for software updates, say). Outside services can't start a connection in.
Route tableThe VPC's traffic controller. Each route says "traffic for this destination goes to this target". Every subnet has one.
VPC endpointPrivate access from your VPC to AWS services, with no internet gateway or NAT device.

AWS PrivateLink is the technology behind most VPC endpoints. It connects your VPC privately to AWS services, other accounts' services or AWS Marketplace partner services. Amazon S3 and DynamoDB also offer free gateway endpoints.

[264][265][266][267][268]

Rendering diagram…
Shoppers reach only the load balancer. Servers and database sit in the private subnet.

[263][265][268]

[265][277]

Cedar Lane Books' web servers run in a private subnet. They must download security patches from the internet, but nobody on the internet may start a connection to them. Which VPC component meets this requirement?

Pick one answer.

[265]

Connecting VPCs: peering, Transit Gateway and PrivateLink

Exam depth: recognize it.

OptionWhat it connectsThe question says
VPC peeringTwo VPCs, one to one, using private IP addresses. Not transitive: if A peers with B and C, B still can't reach C."connect two VPCs".
AWS Transit GatewayMany VPCs and on-premises networks through one central hub."hub", "many VPCs", "simplify", "plus on-premises".
AWS PrivateLinkYour VPC to one specific service, privately, without the internet."privately access a service", "no internet exposure".

Decision rule: two VPCs, peering. Dozens of VPCs and offices, Transit Gateway. One service reached privately, PrivateLink.

[267][269][270][271]

A retailer has 30 VPCs and two on-premises data centers. Managing dozens of one-to-one connections has become error-prone. The company wants one central hub that connects all of them. Which AWS service meets this requirement?

Pick one answer.

[270][271]

Security group: remembers you on the way out. Network ACL: checks your ticket both ways, every time. Picture: Isometric diagram cartoon, clean pastel colors.

Security groups versus network ACLs

Exam depth: know it cold.

A security group is a virtual firewall around a resource, such as an EC2 instance. A network ACL (access control list) is a firewall at the edge of a subnet.

Security groupNetwork ACL
Works atInstance (resource) level.Subnet level.
RulesAllow rules only.Allow and deny rules.
How rules are readAll rules, before deciding.In number order, lowest first. The first match wins.
Return trafficAllowed automatically: stateful.Must be allowed by a rule: stateless.

Stateful means it remembers a request, so the reply gets out without a rule. Stateless means every packet is checked fresh, in both directions.

Decision rule: block one specific IP address, or need a deny rule? Network ACL. Everything else starts with security groups.

[272][273][274]

Watch it happen · 15 s

A shopper's request passes two firewalls

A shopper's request enters the VPC through the internet gateway.

Scene 1 of 6

[272][273]

[274]

Cedar Lane Books sees attack traffic from one IP address range. It wants to block that range for every instance in its public subnet, while normal shoppers keep access. What should it use?

Pick one answer.

Watching and checking VPC traffic

Exam depth: recognize it.

  • VPC Flow Logs record which IP traffic goes to and from the network interfaces in your VPC. They go to Amazon CloudWatch Logs, Amazon S3 or Amazon Data Firehose. Use them to see what reaches an instance, or to spot a security group that blocks too much.
  • Amazon Inspector (lesson 12) also checks VPC security. Its network reachability findings flag EC2 instances with ports open to the internet or other networks. Those findings point to security groups or network ACLs that are too open.

Rule: "record network traffic" is Flow Logs. "Find instances exposed by open ports" is Inspector.

[122][275][276]

[7]

Exam-style practice

Which VPC feature acts as a stateful firewall at the instance level?

Pick one answer.

[274]

A bank's application runs in private subnets with no internet gateway. It must call a partner's service hosted in another AWS account, and the traffic must not cross the public internet. Which AWS service meets this requirement?

Pick one answer.

[267]

FlashcardsIndex cardsFlashcards ⚡

Card 1 of 17

[260][263][265][267][271][274][275][276]

Worth keeping

  1. A VPC is your isolated network in one Region. Subnets sit in one AZ each.
  2. Public subnet means a route to an internet gateway. Private subnets reach out through a NAT gateway.
  3. Security group: instance, allow only, stateful. Network ACL: subnet, allow and deny, stateless.
  4. Two VPCs: peering. Many VPCs and offices: Transit Gateway. One service privately: PrivateLink.
  5. Flow Logs record traffic. Inspector flags instances left open.

On the job

Security reviews and customer questionnaires often ask, "Is the database reachable from the internet?" With a VPC you can answer in one breath: "No. It's in a private subnet with no route to an internet gateway. Its security group only accepts traffic from our web servers."

A project manager who can say that saves the engineers a meeting. A salesperson who can say it closes a security review faster.

Cedar Lane Books' network is built, but the 14 stores still sit outside it, and European shoppers are far away. Next lesson: Route 53, CloudFront, VPN and Direct Connect, or how users and offices actually reach the VPC.

Leaderboard

Loading…

50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.

Embed this practice on your site

Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.

Report a copyright problem with this lesson

Sources for this lesson (21)

Each fact in the lesson is marked with the number of the page it comes from.

  1. [4]AWS: CLF-C02 Content Domain 3: Cloud Technology and Services
  2. [7]AWS: CLF-C02 Out-of-Scope AWS Services
  3. [122]AWS: What is Amazon Inspector?
  4. [260]AWS: What is Amazon VPC?
  5. [261]AWS: How Amazon VPC works
  6. [262]AWS: VPC CIDR blocks
  7. [263]AWS: Subnets for your VPC
  8. [264]AWS: Enable internet access for a VPC using an internet gateway
  9. [265]AWS: NAT gateways
  10. [266]AWS: Configure route tables
  11. [267]AWS: What is AWS PrivateLink?
  12. [268]AWS: Gateway endpoints
  13. [269]AWS: What is VPC peering?
  14. [270]AWS: How VPC peering connections work
  15. [271]AWS: What is AWS Transit Gateway for Amazon VPC?
  16. [272]AWS: Control traffic to your AWS resources using security groups
  17. [273]AWS: Control subnet traffic with network access control lists
  18. [274]AWS: Infrastructure security in Amazon VPC
  19. [275]AWS: Logging IP traffic using VPC Flow Logs
  20. [276]AWS: Amazon Inspector finding types
  21. [277]AWS: Regional NAT gateways for automatic multi-AZ expansion