Brainbotox · Lessons · Exams

AWS Architect Associate

by lazizanie · Networks & cloud · AWS ARCHITECT ASSOCIATE · English · ★ 5.0 (1)

Full AWS Solutions Architect Associate (SAA-C03) notes in 30 chapters: compute, storage, databases, networking and VPC, serverless, security, analytics, DR, with a 10 question quiz after each chapter.

Study this lesson with its quizzes on Brainbotox →

Chapter 1: IAM, Identity and Access Management

IAM controls who can do what in your AWS account. Rule number one: give every identity the least privilege it needs.

Root account, users and groups

  • Root account: created with the account. Use it only for initial setup, then create your own IAM user.
  • Users: one user per physical person.
  • Groups: mirror your organization. A user can belong to several groups. Groups contain users only, never other groups.
  • Permissions are given to users or groups through JSON policies.

Policies (JSON structure)

Write them by hand or build them in the console, which generates the JSON.

{
  "Version": "2012-10-17",
  "Id": "optional-id",
  "Statement": [
    {
      "Sid": "optional-identifier",
      "Effect": "Allow",
      "Principal": { "AWS": ["arn:aws:iam::123456789012:root"] },
      "Action": ["s3:GetObject"],
      "Resource": ["arn:aws:s3:::mybucket/*"],
      "Condition": {}
    }
  ]
}
FieldMeaningRequired
VersionPolicy language versionYes
IdPolicy identifierNo
StatementList of one or more rulesYes
SidStatement identifierNo
EffectAllow or DenyYes
PrincipalAccount, user or role the policy applies toYes (resource policies)
ActionAPI actions allowed or deniedYes
ResourceResources the actions apply toYes
ConditionWhen the statement is in effectNo

Protecting accounts

  • Password policy: rules on length, complexity, rotation and reuse.
  • MFA: a password you know plus a device you own.
    • Virtual MFA device: Google Authenticator, Authy
    • U2F security key: USB key such as YubiKey
    • Hardware key fob

Ways to access AWS

  1. Management Console: password plus MFA.
  2. AWS CLI: generate an access key for your user, then use it from your terminal.
  3. AWS CloudShell: a terminal hosted by AWS in your browser, only in some regions.

IAM roles

A role lets an AWS service (for example an EC2 instance) act on your behalf, without storing credentials on it.

IAM security tools

ToolLevelWhat it shows
Credentials ReportAccountAll users and the status of their credentials
Access AdvisorUserPermissions granted and when each service was last used; use it to trim policies

IAM best practices

  • Do not use the root account except for initial setup
  • One IAM user per person
  • Manage permissions through groups
  • Enforce a strong password policy
  • Enforce MFA
  • Use IAM roles to give permissions to AWS services
  • Audit permissions regularly (Credentials Report, Access Advisor)
  • Never share credentials or access keys
Check yourself

Can a group contain another group?

No. Groups contain users only.

Which tool shows when a user last used a service?

IAM Access Advisor (user level).

How should an EC2 instance get AWS permissions?

Through an IAM role, never by storing access keys on it.

Check yourself

  1. What is the best practice for the AWS root account?
  2. An IAM group can contain other groups.
  3. Which IAM tool shows a user's permissions and when each service was last accessed?
  4. How should an EC2 instance get permission to call other AWS services?
  5. Which policy field names the account, user or role a policy applies to, and is required in resource based policies?
  6. Which fields are required in an IAM policy statement?
  7. Which tool lists all users in the account and the status of their credentials?
  8. What does MFA combine?
  9. Which are valid MFA device options in AWS?
  10. Best practice is to manage permissions by attaching policies to groups rather than to each user individually.

Take the quiz on Brainbotox

Chapter 2: EC2 basics, instance types and security groups

EC2 is AWS's infrastructure as a service: you rent virtual machines and pick their OS, size, network, firewall and pricing model.

Before you start: use AWS Budgets and Cost Management to set alerts when spending crosses your threshold.

What EC2 is made of

ComponentRole
EC2 instancesVirtual machines
EBSNetwork drives that store data
ELBElastic Load Balancing, spreads traffic across instances
ASGAuto Scaling Group, adds or removes instances with demand

Configuration options

OptionChoices
OSLinux, macOS, Windows
CPUNumber of cores
RAMAmount of memory
StorageNetwork attached (EBS) or hardware (instance store)
Network cardSpeed, public IP address
Firewall rulesSecurity groups
Bootstrap scriptEC2 User Data

Bootstrap (User Data): a script that runs once, at the instance's first start, to install whatever the machine needs.

Instance types

FamilyOptimized forExample uses
General purpose (T, M)Balance of CPU, memory, networkWeb servers, code repositories
Compute optimized (C)High CPUBatch processing, media transcoding, high performance web servers
Memory optimized (R, X)Large RAMHigh performance databases, big in memory data processing
Storage optimized (I, D)Fast local storageOLTP databases, Redis cache, distributed file systems

T is the burstable family; M is the main general purpose family.

Security groups (firewall for EC2)

  • Contain allow rules only.
  • Rules reference an IP range or another security group.
  • Control access ports, authorized IP ranges, inbound and outbound traffic.
  • Can be attached to multiple instances.
  • Locked to one region and VPC combination.
  • Live outside the instance: blocked traffic never reaches it.
  • Good practice: a separate security group for SSH access.
  • A connection timeout is usually a security group problem.

Ports to know (tap a card to reveal the port)

SSHLinux login22
SFTPFiles over SSH22
FTPFiles, unsecured21
HTTPUnsecured web80
HTTPSSecured web443
RDPWindows desktop3389

Connecting and access rights

  • Default user on Amazon Linux AMI: ec2-user.
  • EC2 Instance Connect: browser based terminal, no SSH key management.
  • Access rights: never type your own credentials (aws configure) into an instance, anyone connecting to it could retrieve them. Attach an IAM role instead.
Check yourself

Your SSH connection times out. First suspect?

The security group: port 22 is probably not open to your IP.

Can a security group contain a deny rule?

No. Security groups only contain allow rules.

Which family for an in memory database?

Memory optimized (R series).

Check yourself

  1. Your SSH connection to an EC2 instance times out. What is the most likely cause?
  2. Security groups can contain both allow and deny rules.
  3. Which instance family fits a high performance in memory database?
  4. What runs a bootstrap script once, at an instance's first start?
  5. Which port does RDP (Windows remote desktop) use?
  6. Which instance family suits batch processing and media transcoding?
  7. Which statements about security groups are true?
  8. What is the default user on an Amazon Linux AMI?
  9. Which option gives a browser based terminal into an instance without managing SSH keys?
  10. Which family suits OLTP databases and distributed file systems that need fast local storage?

Take the quiz on Brainbotox

Chapter 3: EC2 pricing, spot, networking and hibernate

How you pay for EC2, how spot instances work, and how instances get IPs and are placed on hardware.

Purchase options

OptionDiscountCommitmentBest for
On demandNoneNoneShort, uninterrupted workloads
Reserved InstancesUp to 72%1 or 3 yearsLong, steady workloads
Savings PlansUp to 72%1 or 3 years, $ per hourLong workloads, flexible size and OS
Spot InstancesUp to 90%NoneShort, failure tolerant workloads
Dedicated HostsVariesOn demand or 1 to 3 yearsCompliance, per server licences
Dedicated InstancesVariesNoneHardware not shared with other customers
Capacity ReservationsNoneNoneGuaranteed capacity in one AZ

Max discount at a glance

On demand 0%
Reserved up to 72%
Savings Plans up to 72%
Spot up to 90%

On demand

  • Linux and Windows: billed per second after the first minute. Other OS: per hour.
  • No upfront payment, no commitment.

Reserved Instances

  • Reserve specific attributes: instance type, region, tenancy, OS.
  • 1 or 3 years. Payment: no upfront, partial upfront, all upfront (more upfront, bigger discount).
  • Scope: regional or zonal. Sell unused ones on the Reserved Instance Marketplace.
  • Convertible RI: can change type, family, OS, scope and tenancy, for a smaller discount.

Savings Plans

  • Commit to a spend, for example $10 per hour, for 1 or 3 years. Usage above it is billed at on demand price.
  • EC2 Instance Savings Plans: locked to an instance family and region (for example m5 in us-east-1), but flexible on size (m5.xlarge, m5.2xlarge), OS and tenancy. Biggest Savings Plan discount.
  • Compute Savings Plans: not locked to a family or region, and also cover Fargate and Lambda. Most flexible, slightly smaller discount.

Spot Instances

  • You can set the max price you are willing to pay (optional, defaults to the on demand price). If the spot price goes above it, or AWS needs the capacity back, you lose the instance.
  • The spot price moves gradually with long term supply and demand. There is no live bidding (AWS dropped that model in 2017).
  • For failure tolerant work: batch jobs, data analysis, image processing. Not for critical jobs or databases.

Dedicated Hosts

  • A whole physical server for you, with visibility on sockets and cores.
  • For compliance and bring your own licence (per socket, core or VM, e.g. SQL Server). You control placement. Most expensive.

Dedicated Instances

  • Hardware dedicated to you, but not a full server; may share hardware with other instances in your account. No control over placement.

Capacity Reservations

  • Reserve on demand capacity in a specific AZ, any duration, cancel any time, no discount.
  • Billed at on demand rate whether the instance runs or not.

Spot instances in depth

  • If the spot price goes above your max, or AWS reclaims the capacity, you get a 2 minute warning to stop or terminate (action can be predefined).
  • One time request: once the instance is lost, it's over.
  • Persistent request: the instance comes back when capacity and price allow.
  • To stop relaunches: cancel the request first (open, active or disabled state), then terminate the instances yourself.
  • Spot Fleet: spot plus optional on demand instances, meeting a target capacity within a price limit. You define launch pools (type, OS, AZ).
Allocation strategyPicks from
lowestPriceThe pool with the lowest price
diversifiedAll pools, for availability
capacityOptimizedThe pool with the most capacity
priceCapacityOptimizedRecommended: highest capacity pools first, then lowest price

IP addresses

  • A public IPv4 changes every time you stop and start the instance. The private IP stays.
  • For a fixed public IP, use an Elastic IP. Every public IPv4 costs about $0.005 per hour.

Placement groups

StrategyPlacementLimitUse case
ClusterClose together, single AZNoneLow latency, high throughput; one rack failure hits all
SpreadEach on different hardware7 instances per AZ per groupCritical apps, maximum availability
PartitionPartitions on separate racks7 partitions per AZ, hundreds of instancesBig data (HDFS, Cassandra, Kafka)

Elastic Network Interface (ENI)

  • A virtual network card: one primary private IPv4, plus secondary ones, one Elastic IP per private IPv4.
  • Bound to a specific AZ.
  • Can be moved to another instance, useful for network failover between two instances running the same app.

EC2 Hibernate

Like putting your PC to sleep: faster restart because the OS does not boot again.

  • RAM is saved to the root EBS volume.
  • Root EBS must be encrypted and large enough to hold the RAM.
  • Max 60 days hibernated.
Exam quick recall

Cheapest for interruptible batch jobs?

Spot instances, up to 90% off.

Licences tied to physical cores?

Dedicated Hosts.

Lowest latency between instances?

Cluster placement group.

Does cancelling a spot request terminate instances?

No. Cancel the request, then terminate the instances yourself.

Commit to spend but move between regions and use Lambda?

Compute Savings Plans.

Check yourself

  1. Which purchase option gives the biggest discount for a failure tolerant batch job?
  2. You must use server bound software licences and control instance placement. Which option?
  3. Which placement group gives the lowest network latency between instances?
  4. Cancelling a persistent spot request automatically terminates its running instances.
  5. Which statements about EC2 Hibernate are true?
  6. What happens to an instance's public IPv4 address when you stop and start it?
  7. How many instances per AZ can a spread placement group hold?
  8. Which Spot Fleet allocation strategy is recommended, picking the highest capacity pools first, then the lowest price?
  9. Which option reserves on demand capacity in a specific AZ, with no discount, billed whether the instance runs or not?
  10. A Kafka or Cassandra cluster of hundreds of instances must spread across racks. Which placement group?

Take the quiz on Brainbotox

Chapter 4: EBS, AMI, instance store and EFS

Storage for EC2: network disks (EBS), machine images (AMI), local disks (instance store) and shared file systems (EFS).

EBS volume (Elastic Block Store)

  • A network drive you attach to an instance.
  • Bound to one AZ. To move it to another AZ, snapshot it first.
  • Attached to one instance at a time (except io1/io2 multi attach), but one instance can have several EBS volumes.
  • Root EBS is deleted with the instance by default. You can change this to preserve it. Other volumes are kept by default.

EBS snapshots

  • A backup of the volume at a point in time. Can be copied across AZ and region.
  • Snapshot Archive: 75% cheaper, but 24 to 72 hours to restore.
  • Recycle Bin: rules to keep deleted snapshots so you can recover them after an accidental delete. Retention 1 day to 1 year.
  • Fast Snapshot Restore (FSR): full initialisation, no latency on first use. Expensive ($$$).

AMI (Amazon Machine Image)

A custom EC2 template: your OS, software and config pre-packaged, so instances boot and configure faster.

  • Built for a specific region, and can be copied to other regions.
  • Types: public AMI (AWS provided), your own AMI (a "golden AMI"), AWS Marketplace AMI (made and sometimes sold by others).

Process

  1. Start an EC2 instance and customise it.
  2. Stop it, for data integrity.
  3. Build an AMI from it (this also creates EBS snapshots).
  4. Launch new instances from the AMI.

EC2 instance store

  • A real hardware disk physically attached to the host. Use it when EBS performance is not enough.
  • Much better I/O performance.
  • Ephemeral: data is lost if the instance is stopped or the hardware fails.
  • Good for buffer, cache, scratch and temporary content.
  • Backups and replication are your responsibility.

EBS volume types

TypeDiskUse
gp2 / gp3SSDGeneral purpose, balance of price and performance
io1 / io2 Block ExpressSSDHighest performance, low latency, high throughput
st1HDDLow cost, frequently accessed, throughput heavy
sc1HDDLowest cost, less frequently accessed

Only gp2/gp3 and io1/io2 can be boot volumes.

General purpose SSD

  • gp2: 1 GB to 16 TB. 3 IOPS per GB, so IOPS are tied to size. Max 16,000 IOPS.
  • gp3 (newer): baseline 3,000 IOPS and 125 MB/s at any size. You can raise IOPS and throughput independently of size: since September 2025, up to 80,000 IOPS and 2,000 MB/s, on volumes up to 64 TB.
Exam note: many practice exams and courses still quote the old gp3 limits (16,000 IOPS, 1,000 MB/s, 16 TB). The key idea is unchanged: gp3 performance is decoupled from size, gp2 is not.

Provisioned IOPS SSD (PIOPS)

  • For the most demanding databases: highest sustained IOPS, lowest latency and the most consistent performance.
  • io1: 4 GB to 16 TB. Max 64,000 IOPS on Nitro instances, 32,000 on others. IOPS set independently of size.
  • io2 Block Express: 4 GB to 64 TB, sub-millisecond latency, max 256,000 IOPS, ratio 1,000 IOPS per GB.
  • Supports multi attach (see below).

EBS multi attach

  • io1/io2 only: one volume attached to several instances in the same AZ.
  • Each instance has full read and write access.
  • Max 16 instances.
  • Must use a cluster-aware file system.

EBS encryption

  • When a volume is encrypted, the data at rest, the data in flight, all snapshots and all volumes created from those snapshots are encrypted.
  • Handled transparently, minimal impact on latency.
  • Uses KMS keys (AES-256).
  • To encrypt an unencrypted volume: snapshot it, copy the snapshot with encryption on, create a volume from it.

EFS (Elastic File System)

  • Managed network file system (NFS) that can be mounted on many EC2 instances, across multiple AZ.
  • Highly available, scalable, expensive. Pay per use, no capacity planning, it grows and shrinks on its own.
  • Access controlled with security groups. Encryption at rest with KMS.
  • Linux AMIs only (POSIX), not Windows.

Scale and performance mode

  • Thousands of concurrent clients.
  • Performance mode, set at creation: General Purpose (default, low latency, web servers, CMS) or Max I/O (higher latency, higher throughput, highly parallel, big data).

Throughput mode

  • Bursting: 1 TB gives 50 MB/s, with bursts up to 100 MB/s.
  • Provisioned: set your throughput regardless of storage size.
  • Elastic: scales up and down automatically with the workload. Recommended for unpredictable workloads.

Storage classes

  • Standard: frequently accessed files.
  • Infrequent Access (IA): cost to retrieve a file, lower storage price.
  • Archive: rarely accessed data (a few times a year), about 50% cheaper.
  • Availability: multi-AZ (production) or One Zone (dev, cheaper).
  • Lifecycle policies move files to a cheaper tier after N days without access.
Exam quick recall

Move an EBS volume to another AZ?

Snapshot it, then restore the snapshot in the other AZ.

Highest disk I/O, data loss acceptable?

EC2 instance store.

Need 10,000 IOPS on a small volume, cheapest SSD?

gp3, since its IOPS are independent of size.

Shared file system for 50 Linux instances across AZ?

EFS.

Which EBS types can be boot volumes?

gp2, gp3, io1, io2. Never st1 or sc1.

Check yourself

  1. How do you move an EBS volume to another Availability Zone?
  2. Which EBS volume types can be used as boot volumes?
  3. Which gp volume lets you set IOPS independently of its size?
  4. You need the highest disk I/O and losing data on stop is acceptable. What do you use?
  5. EFS can be mounted on Windows EC2 instances.
  6. What is the maximum number of instances an io1/io2 volume can be multi attached to?
  7. How do you encrypt an existing unencrypted EBS volume?
  8. By default, the root EBS volume is deleted when its instance is terminated.
  9. Which EBS snapshot feature is about 75% cheaper but takes 24 to 72 hours to restore?
  10. A highly parallel big data job runs on EFS and can accept higher latency for more throughput. Which performance mode?

Take the quiz on Brainbotox

Chapter 5: Elastic Load Balancing

How ELB spreads traffic, the four LB types, sticky sessions, cross zone, TLS and draining.

The four types

TypeYearProtocolsNotes
Classic (CLB)2009HTTP, HTTPS, TCP, SSLOld generation, deprecated
Application (ALB)2016HTTP, HTTPS, WebSocketLayer 7
Network (NLB)2017TCP, TLS, UDPLayer 4, high performance
Gateway (GWLB)2020IP packetsLayer 3, security appliances

Security groups

  • The LB security group allows external traffic (HTTP/HTTPS from anywhere).
  • The EC2 security group allows traffic only from the LB security group (link SG to SG).

Application Load Balancer

  • Routes to different target groups with rules on: path in URL, hostname in URL, query string, headers.
  • Target groups can be EC2 instances, ECS tasks, Lambda functions, or private IP addresses.
  • Great for microservices and containers (Docker, ECS). Has a port mapping feature to redirect to a dynamic port in ECS.
  • Fixed hostname, no Elastic IP.
  • The app server does not see the client IP directly. It is inserted in the header X-Forwarded-For (also X-Forwarded-Port and X-Forwarded-Proto).

Network Load Balancer

  • Lower level: forwards TCP and UDP traffic.
  • One static IP per AZ, and supports assigning an Elastic IP.
  • Ultra low latency, millions of requests per second. Good for performance.

Gateway Load Balancer

  • Deploy, scale and manage a fleet of third party virtual network appliances: firewalls, intrusion detection, deep packet inspection.
  • Operates at layer 3 (network layer), on IP packets.
  • Distributes traffic to your virtual appliances.
  • Uses the GENEVE protocol on port 6081.

Sticky sessions (session affinity)

  • Available on CLB, ALB and NLB.
  • A cookie, with an expiry you control, sends the same user to the same instance so they don't lose their session.

Application based cookies

  • Custom cookie: generated by the target, can include any attribute. The name is set per target group and must not be AWSALB, AWSALBAPP or AWSALBTG (reserved).
  • Application cookie: generated by the LB, name is AWSALBAPP.

Duration based cookie

  • Generated by the LB. Name AWSALB for ALB, AWSELB for CLB.

Cross zone load balancing

Spreads traffic evenly across all instances in all AZ, not just evenly across AZ. Example: AZ1 has 2 instances, AZ2 has 8, the LB sends 50% to each AZ.

AZ 1 (50% of traffic)
AZ 2 (50% of traffic)
LBDefaultInter-AZ cost
ALBEnabled (can disable per target group)No charge
NLB and GWLBDisabledYou pay if you enable it
CLBDisabledNo charge if enabled

SSL/TLS

  • A certificate encrypts traffic in transit between clients and the LB (in flight encryption).
  • TLS is the newer version of SSL.
  • LBs use X.509 certificates, managed with ACM (AWS Certificate Manager).

SNI (Server Name Indication)

  • Solves loading multiple SSL certificates on one web server, so one LB serves several websites.
  • Newer protocol: the client indicates the target hostname in the initial SSL handshake.
  • Only with ALB, NLB and CloudFront (not CLB).

Connection draining

  • Called Connection Draining on CLB, Deregistration Delay on ALB and NLB.
  • Time given to complete in flight requests while an instance is de-registering or unhealthy.
  • The LB stops sending new requests to the instance in draining mode.
  • 1 to 3,600 seconds (default 300), 0 disables it. Set it low if your requests are short.
Exam quick recall

Need a static IP or Elastic IP on the LB?

NLB.

Route /users and /orders to different services?

ALB with path based rules.

How does the app get the client IP behind an ALB?

X-Forwarded-For header.

Inspect all traffic through third party firewalls?

GWLB, GENEVE on port 6081.

Several HTTPS sites behind one LB?

SNI, on ALB or NLB.

Check yourself

  1. Which load balancer gives you a static IP per AZ and supports Elastic IPs?
  2. Behind an ALB, how does your app read the client's real IP?
  3. Which protocol and port does the Gateway Load Balancer use?
  4. Cross zone is off. AZ1 has 2 instances, AZ2 has 8, the LB sends 50% to each AZ. What does each AZ2 instance get?
  5. Which feature lets one load balancer serve several websites, each with its own SSL certificate?
  6. How should the EC2 instances' security group be set up behind a load balancer?
  7. You need to route /users and /orders to different target groups. Which load balancer?
  8. What is connection draining called on ALB and NLB, and what is its default?
  9. What is the default cross zone setting on an NLB?
  10. An Application Load Balancer can be assigned an Elastic IP.

Take the quiz on Brainbotox

Chapter 6: Auto Scaling Groups

Add and remove EC2 instances automatically to match the load.

What an ASG does

  • Scale out: add instances when load goes up.
  • Scale in: remove instances when load goes down.
  • You set a minimum, desired and maximum capacity.
  • Works with a load balancer: new instances are registered automatically and receive traffic. Unhealthy ones are replaced.
  • The ASG itself is free, you only pay for the instances.
min
desired
up to max

Launch template vs ASG settings

The launch template describes what each new instance looks like:

  • AMI and instance type
  • EC2 user data
  • EBS volumes
  • Security groups
  • SSH key pair
  • IAM role for your instances
  • Network settings (optional)

The ASG itself holds where and how many:

  • Subnets / AZ to launch into
  • Minimum, desired and maximum capacity
  • The load balancer target group instances are registered with
  • Health checks and scaling policies

You can scale in or out based on CloudWatch alarms, which monitor a metric such as average CPU.

Use a ready made AMI to reduce configuration time, so new instances serve requests faster.

Scaling policies

PolicyHow it worksExample
Target trackingDynamic, simplest. Keep a metric at a target.Keep average CPU at 40%
Simple / stepDynamic, triggered by CloudWatch alarmsCPU over 70%: add 2. Under 30%: remove 1
ScheduledAnticipate a known patternRaise minimum to 10 every Friday at 5 pm
PredictiveAnalyses historical data, forecasts load, schedules scaling actions aheadDaily traffic peaks

Good metrics to scale on

  • CPUUtilization
  • RequestCountPerTarget (requests per EC2)
  • Average Network In / Out
  • Any custom CloudWatch metric

Cooldown

  • After a scaling action there is a cooldown period (default 300 s).
  • During it, the ASG launches or terminates nothing more, so metrics can stabilise.
Exam quick recall

Keep average CPU around 40% with the least setup?

Target tracking policy.

Big known event every Monday morning?

Scheduled scaling.

Why does the ASG wait after scaling?

The 300 s default cooldown lets metrics stabilise.

How to make new instances ready faster?

Use a pre-baked AMI to cut boot and config time.

Where do you attach the load balancer: launch template or ASG?

The ASG, through its target group.

Check yourself

  1. You want an ASG to keep average CPU at about 40% with the least configuration. Which policy?
  2. What is the default ASG cooldown after a scaling action?
  3. You need to raise the minimum capacity to 10 every Friday at 5 pm. Which policy?
  4. Which policy analyses historical data, forecasts load and schedules scaling actions ahead of time?
  5. You pay an hourly fee for the Auto Scaling Group itself, on top of the instances.
  6. Which capacity values do you set on an ASG?
  7. What does an ASG do with an instance that fails its health check behind a load balancer?
  8. Which are good metrics to scale an ASG on?
  9. How can you make newly launched instances start serving requests faster?
  10. What triggers simple and step scaling policies?

Take the quiz on Brainbotox

Chapter 7: RDS and Aurora

AWS managed relational databases: replicas, Multi-AZ, Aurora's architecture, backups, security and RDS Proxy.

RDS (Relational Database Service)

Engines: PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, IBM Db2, and Aurora (AWS's own).

A managed service, so you get by default:

  • Automated provisioning and OS patching
  • Continuous backups and point in time restore
  • Monitoring dashboards
  • Read replicas
  • Multi-AZ for disaster recovery
  • Maintenance windows for upgrades
  • Vertical and horizontal scaling
  • Storage backed by EBS

You can't SSH into an RDS instance, it's a service (except RDS Custom).

Storage auto scaling

  • Detects when you are running out of space and increases storage dynamically.
  • You set a maximum storage threshold.

Read replicas vs Multi-AZ

Read replicasMulti-AZ (instance deployment)
GoalScale readsDisaster recovery
How manyUp to 15One standby
WhereSame AZ, cross AZ or cross regionA different AZ
ReplicationAsynchronousSynchronous
Readable?Yes, app connects to themNo, not used for scaling
FailoverCan be promoted to its own DBAutomatic, one DNS name switches over
  • Use case: a reporting app reads from a replica so it doesn't overload the main DB.
  • Network cost: replication between AZ in the same region is free (managed service). Cross region replication is paid.
  • A read replica can be set up as Multi-AZ for DR.
  • Single AZ to Multi-AZ: zero downtime, just modify the database option.
  • Multi-AZ DB cluster (MySQL and PostgreSQL): a second Multi-AZ option with one writer and two readable standbys in different AZ. Faster failover, and the standbys can also serve reads.

RDS Custom

  • For Oracle and SQL Server.
  • Gives you access to the database and the OS of the underlying EC2 instance, even though it's a managed service.
  • Always take a snapshot before touching the underlying config.

Amazon Aurora

  • Compatible with PostgreSQL and MySQL drivers.
  • Cloud optimised by AWS, faster than standard RDS engines.
  • Storage grows automatically.
  • Up to 15 read replicas, failover is near instantaneous.

High availability and read scaling

  • 6 copies of your data across 3 AZ. 4 of 6 needed for writes, 3 of 6 for reads.
  • Self healing, storage is striped across hundreds of volumes.
  • 1 master (writes) plus up to 15 read replicas. Cross region supported.

Endpoints

  • Writer endpoint: always points to the master.
  • Reader endpoint: load balances across all read replicas.
  • Custom endpoint: aims at a specific subset of replicas, for example the 2 most powerful for analytics.

Aurora Serverless

  • Automated scaling based on actual usage. Good for unpredictable or intermittent workloads.
  • No capacity planning, pay per second, can be more cost effective.

Global Aurora

  • Cross region read replicas: useful for DR, simple to set up.
  • Aurora Global Database (recommended): 1 primary region (read and write), up to 10 secondary read only regions, replication lag under 1 second, up to 16 read replicas per secondary region, decreased latency. Promoting another region takes under 1 minute.

Other features

  • Machine learning: simple integration with AWS ML services (SageMaker, Comprehend). Use cases: fraud detection, ads targeting, sentiment analysis.
  • Babelfish for Aurora PostgreSQL: lets Aurora PostgreSQL understand commands meant for MS SQL Server (T-SQL).
  • Aurora cloning: create a new cluster from an existing one, super fast, using copy on write. Example: build staging from production.

Backups and restore

RDSAurora
Automated backupsDaily full backup plus transaction logs every 5 min, point in time restorePoint in time recovery
Retention1 to 35 days, set 0 to disable1 to 35 days, cannot be disabled
Manual snapshotsManually triggered, kept as long as you wantSame
Trick: a stopped RDS database still costs you storage. If you plan to stop it for a long time, snapshot it and delete it, then restore later. Cheaper.

Restore options

  • Restoring an RDS or Aurora backup creates a new database.
  • Restore MySQL RDS from S3: put an on-premises backup in S3, restore it to a new RDS instance.
  • Restore Aurora MySQL from S3: create the backup with Percona XtraBackup, then restore it to a new cluster.

RDS and Aurora security

  • At rest encryption with KMS, defined at launch time.
  • In flight encryption: TLS ready by default, use the AWS TLS root certificate client side.
  • IAM authentication: connect with IAM roles instead of username and password.
  • Security groups control network access.
  • No SSH, except RDS Custom.
  • Audit logs can be enabled (and sent to CloudWatch Logs).

RDS Proxy

  • Pools and shares DB connections, reducing stress on the DB (CPU, RAM, open connections).
  • Serverless and auto scaled, highly available.
  • Reduces failover time by up to 66%.
  • Enforces IAM authentication, credentials stored in AWS Secrets Manager.
  • Never publicly accessible, only from within the VPC.
Exam quick recall

Scale reads for a reporting tool?

Read replica, app connects to its endpoint.

Survive an AZ outage automatically?

RDS Multi-AZ (synchronous standby, DNS failover).

Aurora writes need how many copies?

4 of 6. Reads need 3 of 6.

Many Lambda functions opening DB connections?

RDS Proxy.

Need OS access on a managed Oracle DB?

RDS Custom.

Fast staging copy of a production Aurora DB?

Aurora cloning.

Check yourself

  1. What is the main purpose of RDS Multi-AZ?
  2. How many copies of data does Aurora keep, and across how many AZ?
  3. Aurora automated backups can be disabled by setting retention to 0.
  4. Thousands of Lambda functions are exhausting database connections. What helps most?
  5. A reporting tool is overloading your main database with reads. What do you add?
  6. You need access to the OS of a managed Oracle database. Which option?
  7. What is the fastest way to build a staging copy of a production Aurora database?
  8. Which Aurora endpoint load balances connections across all read replicas?
  9. Converting an RDS database from Single-AZ to Multi-AZ requires downtime.
  10. With Aurora Global Database, how long does promoting another region take?

Take the quiz on Brainbotox

Chapter 8: ElastiCache and database ports

Managed in-memory caches (Redis or Memcached) to take load off your database.

What it is

  • Managed Redis or Memcached.
  • Used as a cache in front of a DB to speed up queries and reduce DB load.
  • AWS manages the OS, patching, setup, failure recovery and monitoring.
  • Can store user sessions so the app stays stateless.
  • Usually needs application code changes to use it.

Redis vs Memcached

RedisMemcached
Multi-AZ with auto failoverMulti-node for partitioning (sharding) of data
Read replicas for high availabilityNo high availability (no replication)
Data durability with AOF persistenceNot persistent
Backup and restoreBackup and restore (serverless)
Supports sets and sorted setsMulti-threaded architecture
IAM authentication

Security

  • Redis AUTH: set a password or token when you create the Redis cluster. Supports SSL in flight encryption.
  • Memcached: supports SASL based authentication.

Caching patterns

  • Lazy loading: all read data is cached. Data in the cache can become stale.
  • Write through: add or update the cache whenever data is written to the DB. No stale data.
  • Session store: store temporary session data, with a TTL.

Use case: gaming leaderboard

  • Redis sorted sets guarantee uniqueness and element ordering.
  • Each time an element is added, it's ranked in real time and placed in the right order.

Database ports to know

Tap a database to reveal its port.

Exam quick recall

Real time leaderboard?

ElastiCache for Redis, sorted sets.

Cache needs HA and persistence?

Redis, not Memcached.

Simple multi-threaded cache, data loss acceptable?

Memcached.

Avoid stale cache data?

Write through pattern.

Check yourself

  1. You need a real time gaming leaderboard. What fits best?
  2. Which port does Oracle use by default?
  3. Your cache needs high availability, persistence and backups. Which engine?
  4. Which caching pattern updates the cache every time data is written to the database, so it is never stale?
  5. What is the main drawback of lazy loading?
  6. Which default port do MySQL and MariaDB use?
  7. Which default port does SQL Server use?
  8. How does Memcached authenticate clients?
  9. Using ElastiCache usually requires changes to your application code.
  10. Which features belong to Memcached?

Take the quiz on Brainbotox

Chapter 9: Route 53

AWS's DNS service: records, hosted zones, CNAME vs Alias, routing policies and health checks.

Basics

  • Highly available, scalable, fully managed and authoritative DNS: you can update the DNS records yourself.
  • Also a domain registrar.
  • The only AWS service with a 100% availability SLA.

Each record has

  • Domain or subdomain name, e.g. example.com
  • Record type: A, AAAA, CNAME, NS...
  • Value, e.g. an IP address
  • Routing policy
  • TTL: how long the record is cached by resolvers and clients

Record types

TypeMaps
AHostname to IPv4
AAAAHostname to IPv6
CNAMEHostname to another hostname (which must have an A or AAAA record)
NSName servers for the hosted zone

You can't create a CNAME for the top node of a DNS namespace (zone apex): example.com ✗, www.example.com ✓.

Hosted zones

  • Public hosted zone: records for routing internet traffic.
  • Private hosted zone: records for routing within one or more VPCs.
  • $0.50 per month per hosted zone.

Record TTL

  • Cached on the client side (browser, resolver).
  • High TTL (24 h): less traffic to Route 53, but possibly outdated records.
  • Low TTL (60 s): more traffic (more cost), records are fresher, easy to change.
  • Lower the TTL before a planned change.

CNAME vs Alias

CNAMEAlias
Points toAny hostnameAn AWS resource (ELB, CloudFront, S3 website, API Gateway...)
Root domainNon root only (api.mydomain.com)Root and non root (mydomain.com)
Health checkNoNative health check
CostCharged queriesFree

You cannot set an Alias record for an EC2 DNS name.

Routing policies

PolicyHow it routes
SimpleOne resource, or multiple values in one record and the client picks one at random. No health checks.
WeightedA % of requests to each resource. Records must have the same name and type.
Latency basedTo the resource with the least latency for the user. Can use health checks.
FailoverActive/passive: primary while its health check is OK, secondary otherwise.
GeolocationBased on user location (continent, country, US state). Create a default record for no match.
GeoproximityBy distance to resources, shifted with a bias: the higher the bias, the more traffic goes to that region.
IP basedBy client IP: you provide CIDR blocks mapped to endpoints (e.g. 203.0.113.0/24 to location 1).
Multi-valueReturns multiple healthy records, the client picks. Can use health checks. Not a substitute for an ELB.

Health checks

  • Monitor an endpoint (app, server, other AWS resource), e.g. by region or an ALB.
  • About 15 global health checkers. Threshold of 3 by default. Healthy if more than 18% of checkers say OK.
  • Protocols: HTTP, HTTPS, TCP.

Calculated health checks

  • Combine child health checks with OR, AND, NOT into one parent.
  • Up to 256 child health checks.

Private hosted zones

  • Route 53 health checkers live outside the VPC, so they can't reach private endpoints (private VPC or on premises).
  • Fix: create a CloudWatch metric with an alarm, then a health check that checks the alarm.

Domain registrar vs DNS service

  • You buy a domain from a registrar (GoDaddy, Amazon Registrar...). It usually provides its own DNS service, but you don't have to use it.
  • You can combine the two: register with GoDaddy, create a public hosted zone in Route 53, then set GoDaddy's name servers to the Route 53 name servers.
Exam quick recall

Point example.com (apex) to an ALB?

Alias record. A CNAME can't be used at the zone apex.

Send 10% of traffic to a new version?

Weighted routing.

Serve EU users from the EU for legal reasons?

Geolocation routing (plus a default record).

Shift more traffic toward one region gradually?

Geoproximity with a higher bias.

Health check a private resource?

CloudWatch alarm, then a health check on the alarm.

Check yourself

  1. You want example.com (the zone apex) to point to an ALB. Which record?
  2. Which Route 53 policy sends a chosen percentage of traffic to each resource?
  3. How do you health check a resource inside a private VPC with Route 53?
  4. EU users must be served from the EU for legal reasons. Which routing policy?
  5. You want to gradually shift more traffic toward one region using a bias. Which policy?
  6. Which AWS service has a 100% availability SLA?
  7. What should you do with a record's TTL before a planned change?
  8. You can create an Alias record that points to an EC2 instance's DNS name.
  9. How do calculated health checks combine child health checks?
  10. Your domain is registered with GoDaddy but you want Route 53 to manage DNS. What do you do?

Take the quiz on Brainbotox

Chapter 10: Hybrid DNS, fast app deployment and Elastic Beanstalk

Route 53 Resolver for hybrid networks, ways to start apps fast, and Elastic Beanstalk.

Route 53 Resolver (hybrid DNS)

By default, the Route 53 Resolver in a VPC answers DNS queries for:

  • Local domain names of EC2 instances
  • Records in private hosted zones
  • Records in public name servers

Hybrid DNS: resolve queries between your VPC and your other networks (other DNS resolvers). The other network can be:

  • A peered VPC
  • An on-premises network connected through Direct Connect or AWS VPN

Resolver endpoints

  • Inbound endpoint: lets your on-prem DNS resolvers resolve AWS names, e.g. EC2 instances and records in private hosted zones.
On-prem DNS→Inbound endpoint→Route 53 Resolver
  • Outbound endpoint: Route 53 Resolver forwards queries to your on-prem DNS resolvers (using forwarding rules).
Route 53 Resolver→Outbound endpoint→On-prem DNS

Instantiating applications quickly

ResourceHow to make it start fast
EC2Golden AMI: install everything once, then launch instances from that AMI.
Bootstrap with User Data for dynamic config.
Hybrid: golden AMI plus User Data (what Beanstalk does).
RDSRestore from a snapshot: data and schema are ready.
EBSRestore from a snapshot: the disk is already formatted with data.

Elastic Beanstalk

  • A managed service and a developer-centric central view for deploying an app.
  • Uses all the components we've seen: EC2, ASG, ELB, RDS.
  • Automatically handles capacity provisioning, load balancing, scaling, health monitoring and instance config.
  • Free, you pay for the underlying instances.
  • You still have full control over the configuration.

3 components

  • Application: collection of Beanstalk components (environments, versions, configs).
  • Application version: an iteration of your app code.
  • Environment: collection of AWS resources running one version.
    Tiers: web server tier and worker tier.
    You can run multiple environments (dev, test, prod).

Deployment modes

ModeWhat you getBest for
Single instance1 EC2 with an Elastic IPDev
High availability with LBALB, ASG, RDS Multi-AZProd
Exam quick recall

On-prem servers must resolve names in a private hosted zone?

Route 53 Resolver inbound endpoint.

EC2 instances must resolve an on-prem domain?

Outbound endpoint with a forwarding rule.

Fastest way to boot preconfigured EC2 instances?

Golden AMI, plus User Data for anything dynamic.

Deploy a web app without managing EC2, ASG and ELB yourself?

Elastic Beanstalk.

Check yourself

  1. Your on-prem DNS servers must resolve records in a Route 53 private hosted zone. What do you create?
  2. EC2 instances in your VPC must resolve names in an on-prem domain. What do you set up?
  3. What is the fastest way to boot preconfigured EC2 instances that still need some dynamic config?
  4. How do you get a new RDS database with data and schema ready instantly?
  5. Elastic Beanstalk itself is free: you pay only for the underlying resources.
  6. In Elastic Beanstalk, what is an iteration of your app code called?
  7. Which are Elastic Beanstalk environment tiers?
  8. Which Beanstalk mode gives one EC2 instance with an Elastic IP, ideal for dev?
  9. Hybrid DNS with Route 53 Resolver can work with which networks?
  10. By default, the Route 53 Resolver in a VPC answers queries for which names?

Take the quiz on Brainbotox

Chapter 11: S3 basics, policies, versioning and replication

Buckets and objects, who can access them, versioning and replication.

Use cases

Backup and storage, disaster recovery, archive, hybrid cloud storage, application hosting, media hosting, data lakes and big data analytics, static websites.

Buckets and objects

  • Buckets are top level directories; files are objects.
  • A bucket name must be globally unique (across all accounts), but a bucket lives in one region.
  • Each object has a key, which is its full path: s3://my-bucket/my_folder/my_file.txt. There are no real folders, just keys with slashes.
  • Max object size: 5 TB.
  • Above 5 GB you must use multipart upload.

S3 security

  • User based: IAM policies, which API calls a user is allowed to make.
  • Resource based:
    • Bucket policies: bucket wide rules, allow cross account access.
    • Object ACL: fine grained (can be disabled).
    • Bucket ACL: less common (can be disabled).
  • Encryption of objects (see the encryption chapter).

Bucket policy structure (JSON)

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "PublicRead",
    "Effect": "Allow",
    "Principal": "*",
    "Action": ["s3:GetObject"],
    "Resource": ["arn:aws:s3:::my-bucket/*"]
  }]
}
  • Resource: buckets and objects
  • Effect: Allow or Deny
  • Actions: set of APIs to allow or deny
  • Principal: the account or user the policy applies to

Use bucket policies to

  • Grant public access to the bucket
  • Force objects to be encrypted at upload
  • Grant access to another account (cross account)

Versioning

  • Enabled at the bucket level.
  • Uploading a file with the same key creates a new version (1, 2, 3...).
  • Best practice: protects against unintended deletes and lets you roll back.

Replication (CRR and SRR)

  • Versioning must be enabled on source and destination buckets.
  • CRR (Cross Region Replication) or SRR (Same Region Replication).
  • Asynchronous. Buckets can be in different AWS accounts.
  • S3 needs the right IAM permissions.
After enabling replication, only new objects are replicated. To replicate existing objects, use S3 Batch Replication.

Delete operations

  • Delete markers can be replicated (optional setting).
  • Deletions with a version ID are not replicated (protects against malicious deletes).

No chaining

Bucket 1→Bucket 2→Bucket 3

If 1 replicates to 2 and 2 replicates to 3, objects from bucket 1 are not copied to bucket 3.

Athena

A serverless query service to run SQL queries directly on files in S3.

Exam quick recall

Uploading a 20 GB file?

Multipart upload is required above 5 GB.

Let another AWS account read your bucket?

Bucket policy with that account as principal.

Turned on CRR, old files didn't copy. Why?

Replication only applies to new objects. Use S3 Batch Replication for existing ones.

Requirement before setting up replication?

Versioning on both buckets.

Check yourself

  1. What is the maximum size of a single S3 object?
  2. You enabled S3 replication on a bucket with existing files. How do you copy the existing objects?
  3. How do you upload a 20 GB file to S3?
  4. S3 bucket names only need to be unique within your own account.
  5. What must be enabled before you can set up S3 replication?
  6. How do you let another AWS account read objects in your bucket?
  7. If bucket 1 replicates to bucket 2, and bucket 2 replicates to bucket 3, objects from bucket 1 also reach bucket 3.
  8. What happens to deletions made with a specific version ID when replication is on?
  9. Which serverless service lets you run SQL queries directly on files in S3?
  10. What is an S3 object key?

Take the quiz on Brainbotox

Chapter 12: S3 storage classes and lifecycle

Pick the class by how often you read the data and how fast you need it back.

Durability vs availability

  • Durability: 99.999999999% (11 nines), the same for all classes. Store 10,000,000 objects and expect to lose one every 10,000 years.
  • Availability varies by class. Standard is 99.99%, which means about 53 minutes a year not available.

You can change an object's class manually, or automatically with lifecycle rules.

Hot: fast, pricier storageCold: cheap storage, retrieval cost

The classes

ClassAvailabilityKey factsUse cases
Standard99.99%General purpose, low latency, high throughput, survives 2 concurrent facility failuresBig data, mobile and gaming apps, content distribution
Standard-IA99.9%Less frequent access but rapid when needed. Lower storage cost, retrieval feeDR, backups
One Zone-IA99.5%High durability in a single AZ. Data lost if the AZ is destroyedSecondary backups, data you can recreate
Glacier Instant RetrievalMillisecond retrieval. Min storage 90 daysData accessed about once a quarter
Glacier Flexible RetrievalExpedited 1 to 5 min, Standard 3 to 5 h, Bulk 5 to 12 h (free). Min 90 daysArchives
Glacier Deep ArchiveStandard 12 h, Bulk 48 h. Min 180 days. CheapestLong term storage
Intelligent-TieringMoves objects between tiers automaticallyUnknown or changing access patterns

All Glacier classes: low cost for archiving and backup, you pay for storage plus retrieval.

Intelligent-Tiering

  • Small monthly monitoring and auto-tiering fee.
  • Moves objects automatically between access tiers based on usage.
  • No retrieval charges.
TierWhen
Frequent AccessAutomatic, the default tier
Infrequent AccessAutomatic, objects not accessed for 30 days
Archive Instant AccessAutomatic, not accessed for 90 days
Archive AccessOptional, configurable from 90 to 700+ days
Deep Archive AccessOptional, configurable from 180 to 700+ days

S3 Express One Zone

  • High performance class in a single AZ, objects stored in a directory bucket.
  • Handles hundreds of thousands of requests per second with single digit millisecond latency.
  • Up to 10x faster than Standard, with 50% lower request costs.
  • Durability 11 nines, availability 99.95%.
  • Use case: latency sensitive apps (AI/ML training, analytics, HPC).

Lifecycle rules

  • Transition actions: move objects to another storage class automatically, e.g. to Standard-IA after 60 days, to Glacier after 6 months.
  • Expiration actions: delete objects after some time, delete old versions, delete incomplete multipart uploads.
  • Rules can target a prefix (e.g. s3://mybucket/mp3/*) or object tags.

Storage Class Analysis (S3 Analytics)

  • Helps you decide when to transition objects to the right class.
  • Recommendations for Standard and Standard-IA. Does not work for One Zone-IA or Glacier.
  • Takes 24 to 48 hours before you start seeing the analysis.
Exam quick recall

Cheapest storage for data kept 7 years, rarely read, 48 h retrieval OK?

Glacier Deep Archive.

Backups you can easily recreate, lowest cost with fast access?

One Zone-IA.

Unpredictable access, no retrieval fees wanted?

Intelligent-Tiering.

Archive read once a quarter but needed in milliseconds?

Glacier Instant Retrieval.

Clean up abandoned multipart uploads?

Lifecycle expiration rule.

Check yourself

  1. Which S3 class is cheapest for archives you can wait 48 hours to retrieve?
  2. Which S3 class stores data in a single AZ, so data is lost if that AZ is destroyed?
  3. Access patterns are unknown and you don't want retrieval fees. Which class?
  4. Archive data is read about once a quarter but must come back in milliseconds. Which class?
  5. What is the durability of S3 storage classes?
  6. What is the minimum storage duration for Glacier Flexible Retrieval?
  7. How do you automatically clean up abandoned multipart uploads?
  8. Which class uses directory buckets in a single AZ, for single digit millisecond latency?
  9. Storage Class Analysis gives transition recommendations for which classes?
  10. In Intelligent-Tiering, where do objects not accessed for 30 days move automatically?

Take the quiz on Brainbotox

Chapter 13: S3 events, performance, Batch Operations and Storage Lens

Reacting to S3 events, getting more speed, acting on millions of objects, and seeing your storage at a glance.

Event notifications

  • Events: object created, removed, restored, replicated...
  • Can be sent to SNS, SQS or Lambda.
  • Those targets must allow S3 to send to them, using resource access policies on the SNS topic, SQS queue or Lambda function, not IAM roles.

With Amazon EventBridge

  • All S3 events can go to EventBridge, then rules route them to 18+ AWS services as destinations.
  • More granularity and control: advanced filtering, multiple destinations, archive and replay.

Performance

  • S3 scales automatically to high request rates, latency 100 to 200 ms.
  • Per prefix, per second: 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD.
  • No limit on the number of prefixes, so spread reads across prefixes to scale.
Prefixes: → GET/s possible

Faster uploads

  • Multipart upload: recommended above 100 MB, required above 5 GB. Parts upload in parallel.
  • Transfer Acceleration: upload to an AWS edge location, which forwards the data to the target region over the AWS network.

Faster downloads: byte-range fetches

  • Parallelise GETs by requesting specific byte ranges.
  • Better resilience in case of failure (retry just one range).
  • Also lets you read just part of a file, e.g. its header.

S3 Batch Operations

One request to act on many existing objects:

  • Modify object properties and metadata
  • Copy objects between buckets
  • Encrypt unencrypted objects
  • Modify ACLs and tags
  • Restore objects from Glacier
  • Invoke a Lambda function on each object

A job = list of objects + action + optional parameters. S3 manages retries, tracks progress, sends completion notifications and generates reports.

Build the object list with S3 Inventory, then filter it with Athena.

S3 Storage Lens

  • Understand, analyse and optimise storage across an organisation, accounts, regions, buckets or prefixes.
  • Dashboards and reports (a default dashboard, or your own).
Metric groupExamples and use
SummaryBytes used, object count. Find fast growing or unused buckets
Cost optimisationIncomplete multipart uploads older than 7 days, objects that could move to a cheaper class
Data protectionVersioning enabled, MFA Delete enabled, SSE-KMS enabled, cross region replication rule counts
Access managementObject Ownership (bucket owner enforced) count
EventBuckets with event notifications enabled
PerformanceBuckets with Transfer Acceleration enabled
ActivityRequest counts (GET, PUT, LIST...), bytes downloaded
Detailed status codesHTTP status code counts (200, 403...)

Free vs paid

  • Free: 28 usage metrics, data kept 14 days.
  • Paid (advanced): extra metrics, CloudWatch publishing, prefix aggregation, data kept 15 months.
Exam quick recall

Trigger a Lambda when an image lands in S3?

S3 event notification to Lambda, with a resource policy on the function.

Send S3 events to many services with filtering?

EventBridge.

Users far from the bucket region upload slowly?

S3 Transfer Acceleration.

Encrypt millions of existing unencrypted objects?

S3 Batch Operations (list from S3 Inventory).

How many GET/s with 4 prefixes?

4 x 5,500 = 22,000.

Check yourself

  1. How many GET requests per second can S3 handle per prefix?
  2. Users far from your bucket's region complain uploads are slow. What helps?
  3. You need to encrypt millions of existing unencrypted S3 objects. Best tool?
  4. An S3 event notification must trigger a Lambda function. How does S3 get permission to invoke it?
  5. You want S3 events sent to many services with advanced filtering, archive and replay. What do you use?
  6. Your app spreads reads across 4 prefixes. How many GET requests per second can it reach?
  7. You want to parallelise downloads and read only the header of large files. Which technique?
  8. How do you build the object list for an S3 Batch Operations job?
  9. How long does the free tier of S3 Storage Lens keep metrics?
  10. Multipart upload is recommended for files above 100 MB.

Take the quiz on Brainbotox

Chapter 14: S3 encryption and security features

Encrypting objects, forcing HTTPS, locking data (WORM), sharing safely, and access points.

Encryption at rest

MethodKeysUpload headerNotes
SSE-S3Handled and owned by AWS"x-amz-server-side-encryption": "AES256"Default. AES-256
SSE-KMSAWS KMS keys"x-amz-server-side-encryption": "aws:kms"User control, audit key usage with CloudTrail
SSE-CCustomer provided, managed outside AWSYour key in the headers of every requestHTTPS required. S3 never stores your key
Client sideHandled by the clientNoneClient encrypts before upload and decrypts after download
SSE-KMS limit: every upload and download calls the KMS API (GenerateDataKey, Decrypt). These count toward your KMS quota, so a very high throughput bucket can be throttled.

Encryption in transit

  • SSL/TLS: use the HTTPS endpoint.
  • To enforce it, attach a bucket policy that denies requests where aws:SecureTransport is false.
"Condition": { "Bool": { "aws:SecureTransport": "false" } }

Default encryption vs bucket policies

  • Default encryption (SSE-S3) is applied automatically to new objects.
  • A bucket policy can force a specific encryption: refuse any PUT without the right encryption header.
  • Bucket policies are evaluated before default encryption.
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Deny",
    "Action": "s3:PutObject",
    "Principal": "*",
    "Resource": "arn:aws:s3:::my-bucket/*",
    "Condition": {
      "StringNotEquals": {
        "s3:x-amz-server-side-encryption": "aws:kms"
      }
    }
  }]
}

MFA Delete

  • Forces users to generate an MFA code before destructive operations: permanently deleting an object version or suspending versioning.
  • Versioning must be enabled.
  • Only the bucket owner (root account) can enable or disable it.

Access logs

  • Log every request to a bucket into another bucket (same region).
Never set the logging bucket to be the monitored bucket. It creates a logging loop and the bucket grows forever.

Pre-signed URLs

  • A URL that carries the credentials of the user who generated it.
  • Gives a user temporary access to a private object, for a GET or a PUT.
  • Expiry: S3 console 1 min to 720 min (12 h). AWS CLI up to 604,800 s (168 h), default 3,600 s.
  • Examples: let logged in users download a premium video, let a user upload a file to a precise location.

WORM: Glacier Vault Lock and Object Lock

WORM = Write Once Read Many.

Glacier Vault Lock

  • Create a Vault Lock policy, then lock it for future edits. It can no longer be changed or deleted.
  • For compliance and data retention.

S3 Object Lock (versioning required)

  • Blocks deletion of an object version for a specified amount of time.
Retention modeWho can change it
ComplianceNobody, not even root. Mode can't change, period can't be shortened
GovernanceMost users can't, but admins with special IAM permissions can change settings or delete
  • Retention period: protects the object for a fixed period, can be extended.
  • Legal hold: protects the object indefinitely, independent of the retention period. Users with the s3:PutObjectLegalHold IAM permission can add or remove it.

S3 Access Points

Make access management simpler: instead of one huge bucket policy, define access points, each with its own policy and read/write rights.

Finance team→/finance access point + policy→S3 bucket
Sales team→/sales access point + policy→S3 bucket
  • Each access point has its own DNS name.
  • Origin can be internet or VPC (private access only from within the VPC).
  • For VPC origin you must create a VPC endpoint. Its endpoint policy must allow access to the access point and the bucket.
EC2 in VPC→VPC endpoint (endpoint policy)→Access point (access point policy)→Bucket (bucket policy)

S3 Object Lambda

  • Use a Lambda function to modify an object on the fly before the caller receives it.
  • Only one bucket needed, with an S3 access point and an S3 Object Lambda access point on top.
  • Use cases: redact personal data, convert formats (XML to JSON), resize or watermark images per caller.
App←Object Lambda access point←Lambda←S3 access point←Bucket
Exam quick recall

Need to audit who used the encryption key?

SSE-KMS, key usage logged in CloudTrail.

Keys must stay outside AWS, S3 does the encryption?

SSE-C, over HTTPS only.

Reject any request not using HTTPS?

Bucket policy deny when aws:SecureTransport is false.

Data must never be deleted for 7 years, not even by root?

Object Lock in Compliance mode.

Give a customer 1 hour to download a private file?

Pre-signed URL.

Hide personal data from analytics readers without copying the bucket?

S3 Object Lambda.

Check yourself

  1. Which encryption lets you audit key usage in CloudTrail?
  2. Which option requires HTTPS and sending your key with every request?
  3. Records must be undeletable for 7 years, even by the root user. What do you use?
  4. How do you reject any request to a bucket that doesn't use HTTPS?
  5. What is the risk of SSE-KMS on a bucket with very high request rates?
  6. Who can enable or disable MFA Delete on a bucket?
  7. A customer needs 1 hour to download one private file. What do you give them?
  8. You should store S3 access logs in the same bucket you are monitoring.
  9. Analysts must read data with personal details redacted, without copying the bucket. What do you use?
  10. What does an Object Lock legal hold do?

Take the quiz on Brainbotox

Chapter 15: CloudFront and Global Accelerator

Two ways to use AWS's global edge network: caching content near users, or routing traffic fast to your app.

CloudFront

  • CDN (Content Delivery Network): caches content at edge locations all around the world.
  • Improves read performance, and gives DDoS protection (integrated with Shield and WAF).

Origins

  • S3 bucket: distribute and cache files at the edge. Secured with Origin Access Control (OAC) plus an S3 bucket policy.
  • VPC origin: deliver content from apps in private subnets (ALB, NLB, EC2).
  • Custom origin (HTTP): S3 static website, or any public HTTP backend.

Connecting CloudFront to an ALB or EC2

  • Use a VPC origin: traffic goes to private subnets, no need to expose them to the internet.

Geo restriction

  • Allowlist: only the listed countries can access.
  • Blocklist: the listed countries are blocked.

CloudFront vs S3 Cross Region Replication

CloudFrontS3 CRR
NetworkGlobal edge networkMust be set up for each region
FreshnessFiles cached for a TTL (maybe a day)Updated in near real time
AccessReadRead only replicas
Great forStatic content available everywhereDynamic content needed at low latency in a few regions

Pricing and price classes

  • Price per GB of data out varies by edge location region (cheaper in the US, Mexico and Canada than in the Middle East, for example).
Price classEdge locations
Price Class AllAll regions, best performance
Price Class 200Most regions, excludes the most expensive ones
Price Class 100Only the least expensive regions

Cache invalidation

  • Edges refresh content only once the TTL has expired.
  • You can force a full or partial refresh with an invalidation, filtering paths: /* for everything or /images/*.

AWS Global Accelerator

Problem: your app is in one region, users far away suffer lots of latency from hopping across the public internet.

  • Unicast IP: one server holds one IP.
  • Anycast IP: all servers share the same IP, and the client is routed to the nearest one.
  • Global Accelerator uses anycast IPs on the AWS global network: your app gets 2 anycast IPs, and traffic enters AWS at the edge location closest to the user.
  • Endpoints: Elastic IP, EC2, ALB, NLB, public or private.
  • Health checks with fast failover (under 1 minute).
  • No client cache issue: the IPs never change.
  • Security: only 2 IPs to whitelist, DDoS protection with AWS Shield.

CloudFront vs Global Accelerator

Both use the AWS global network and edge locations, and both integrate with Shield for DDoS protection.

CloudFrontGlobal Accelerator
What it doesCaches content, which is served at the edgeProxies packets at the edge to apps running in one or more regions. No caching
ContentCacheable (images, videos) and dynamic (APIs, dynamic sites)Any TCP or UDP application
Best forHTTP content deliveryNon-HTTP uses: gaming (UDP), IoT (MQTT), voice over IP. HTTP apps needing static IPs or fast deterministic regional failover
Exam quick recall

Only CloudFront may read the S3 bucket?

Origin Access Control plus a bucket policy.

Cut CloudFront cost, accept slower access in some regions?

Price Class 100 or 200.

Users still see an old image after an update?

Create a cache invalidation, e.g. /images/*.

UDP game servers worldwide with 2 fixed IPs?

Global Accelerator.

Block users from one country?

CloudFront geo restriction blocklist.

Check yourself

  1. Gaming servers on UDP need 2 fixed global IPs and fast regional failover. Which service?
  2. How do you restrict an S3 bucket so it can only be read through CloudFront?
  3. Users still see an old image after you updated it at the origin. What do you do?
  4. You want to cut CloudFront cost by using only the least expensive edge regions. Which setting?
  5. How do you block users from one country on CloudFront?
  6. Dynamic content must be available at low latency in a few regions, updated in near real time. Best fit?
  7. How many anycast IPs does Global Accelerator give your app?
  8. Global Accelerator caches content at edge locations.
  9. How do you serve content through CloudFront from an ALB in private subnets without exposing it to the internet?
  10. What do CloudFront and Global Accelerator have in common?

Take the quiz on Brainbotox

Chapter 16: Snowball, FSx and Storage Gateway

Moving data physically, third party file systems on AWS, and hybrid cloud storage.

Snowball

Availability change: since 7 November 2025, Snowball Edge is only available to existing customers. For new projects AWS points to DataSync (online transfer), Data Transfer Terminal (secure physical transfer) or partner solutions, and to Outposts for edge computing. Snowball can still appear in exam questions, so learn it anyway.
  • Highly secure, portable device to collect and process data at the edge, and to migrate data into and out of AWS.
DeviceSpecs
Snowball Edge Storage Optimized104 vCPU, 416 GB RAM, 210 TB storage
Snowball Edge Compute Optimized104 vCPU, 416 GB RAM, 28 TB storage
  • Can run EC2 instances and Lambda functions on the device (edge computing).
  • Example: you need compute in a remote location (a boat, a mine...) to process data, then ship the device back to AWS for integration.

Architecture: Snowball into Glacier

Snowball cannot import into Glacier directly. Import into S3 first, then use an S3 lifecycle policy to move the data to Glacier.
Snowball→S3→ lifecycle →Glacier

Amazon FSx

Launch third party high performance file systems on AWS, as a fully managed service. Four flavours: Lustre, Windows File Server, NetApp ONTAP, OpenZFS.

FSx for Windows File Server

  • SMB protocol and Windows NTFS.
  • Active Directory integration, ACLs, user quotas.
  • Can also be mounted on Linux EC2 instances.
  • Supports Microsoft DFS (Distributed File System) namespaces, to group files across on-prem and cloud file systems.
  • Storage: SSD or HDD. Can be Multi-AZ.
  • Can be accessed from on-prem. Backed up daily to S3.

FSx for Lustre (Linux + cluster)

  • Parallel distributed file system for large scale computing.
  • Use cases: HPC, machine learning, video processing, financial modelling.
  • Scales to hundreds of GB/s, millions of IOPS, sub-millisecond latency.
  • Storage: SSD for low latency, IOPS intensive workloads. HDD for throughput intensive workloads.
  • Seamless integration with S3: read S3 as a file system, write results back to S3.
  • Can be accessed from on-prem.
Lustre deploymentScratchPersistent
StorageTemporaryLong term
ReplicationNoneReplicated within the same AZ, failed files replaced in minutes
PerformanceHigh burst (200 MB/s per TiB)Consistent
UsageShort term processing, lower costLong term processing, sensitive data

FSx for NetApp ONTAP

  • Managed NetApp ONTAP on AWS. Compatible with NFS, SMB and iSCSI.
  • Move workloads running on ONTAP or NAS to AWS.
  • Storage shrinks or grows automatically. Snapshots, replication, low cost.
  • Point in time instant cloning (handy for testing new workloads).

FSx for OpenZFS

  • Compatible only with NFS.
  • Move ZFS workloads to AWS. High performance, up to 1M IOPS.
  • Point in time instant cloning.

Hybrid cloud: AWS Storage Gateway

Cloud native storage options:

Block
EBS, EC2 instance store
File
EFS, FSx
Object
S3, Glacier
  • Storage Gateway is a bridge between on-prem data and cloud data.
  • Use cases: disaster recovery, backup and restore, tiered storage, on-prem cache and low latency file access.
  • 3 types: S3 File Gateway, Volume Gateway, Tape Gateway.

S3 File Gateway

On-prem app server⇄ NFS / SMB ⇄S3 File Gateway⇄ HTTPS ⇄S3 bucket
  • Files are stored as S3 objects. Most recently used data is cached on the gateway.
  • Works with S3 storage classes except Glacier. Use a lifecycle policy to move objects to Glacier.

Volume Gateway

On-prem app server⇄ iSCSI ⇄Volume Gateway⇄ HTTPS ⇄S3, backed up as EBS snapshots
  • Goal: back up your on-prem volumes in AWS.
  • Cached volumes: low latency access to the most recent data.
  • Stored volumes: the entire dataset stays on-prem, with scheduled backups to S3.

Tape Gateway

  • A virtual tape library for existing tape based backup software, backed by S3 and Glacier.
Exam quick recall

Move 200 TB into Glacier with a Snowball?

Import to S3, then a lifecycle policy to Glacier.

Windows file share with Active Directory on AWS?

FSx for Windows File Server.

HPC job reading training data from S3 at high speed?

FSx for Lustre (scratch for short jobs, persistent for long term).

Need NFS, SMB and iSCSI from one managed file system?

FSx for NetApp ONTAP.

On-prem servers need to read and write files that live in S3?

S3 File Gateway.

Keep all data on-prem but back it up to AWS?

Volume Gateway, stored volumes.

Check yourself

  1. You must load 200 TB into Glacier using a Snowball device. How?
  2. Which FSx option is built for HPC and ML and integrates seamlessly with S3?
  3. On-prem servers need NFS access to files stored as objects in S3, with a local cache. Which service?
  4. You need a Windows file share with Active Directory integration on AWS. Which service?
  5. One managed file system must serve NFS, SMB and iSCSI. Which service?
  6. You want to keep the full dataset on-prem but back it up to AWS. Which option?
  7. FSx for Windows File Server can also be mounted on Linux EC2 instances.
  8. Which FSx for Lustre deployment suits short term processing at the lowest cost?
  9. Your existing tape based backup software must back up to the cloud. Which service?
  10. You need to process data on a ship with no reliable connection, then send it to AWS. What fits?

Take the quiz on Brainbotox

Chapter 17: DataSync, Transfer Family and choosing a storage service

Moving files into AWS over the network, letting partners upload by FTP, and the big storage comparison table the exam loves.

AWS DataSync

DataSync moves large amounts of data to and from AWS, and keeps it in sync on a schedule.

  • On-prem or other cloud to AWS: needs a DataSync agent (a VM) that reads NFS, SMB, HDFS or S3 API storage.
  • AWS to AWS (S3, EFS, FSx to each other): no agent needed.
  • Destinations: S3 (any storage class, including Glacier), EFS, FSx (all flavours).
  • Runs on a schedule: hourly, daily, weekly. Not continuous.
  • Keeps file permissions and metadata (NFS POSIX, SMB ACLs). Storage Gateway and Snowball don't do this as well.
  • One agent task can use up to 10 Gbps; you can set a bandwidth limit.
  • No network? The agent can run on a Snowcone device you ship back.
On-prem NFS / SMB→ agent → TLS →DataSync→S3 / EFS / FSx

AWS Transfer Family

  • Fully managed FTP, FTPS and SFTP service that writes into S3 or EFS.
  • Use case: partners or legacy apps that only know FTP need to send you files.
  • Scalable, Multi-AZ. Pay per endpoint per hour plus data transferred.
  • Users: managed by the service, or your own identity source (Active Directory, LDAP, Okta, Cognito, custom).
  • Reach it through a public endpoint, or a VPC endpoint (private, can use Elastic IPs and security groups).
Partner FTP client→ SFTP →Transfer Family→ IAM role →S3 / EFS

Storage comparison (exam favourite)

ServiceWhat it isPick it when
S3Object storageAny files, static sites, data lakes, backups
S3 GlacierArchive object storageLong term archives, cheap, slow retrieval
EBSNetwork block storage, one AZDisk for one EC2 instance (multi-attach only io1/io2)
Instance storePhysical disk on the hostMax IOPS, temporary data
EFSNFS for Linux, Multi-AZShared file system for many Linux instances
FSx for WindowsSMB, NTFS, ADWindows file shares
FSx for LustreParallel HPC file systemHPC, ML, linked to S3
FSx for NetApp ONTAPNFS, SMB, iSCSIMoving NetApp / NAS workloads
FSx for OpenZFSNFS onlyMoving ZFS workloads
Storage GatewayHybrid bridgeOn-prem apps using S3 / EBS snapshots / tapes
Transfer FamilyFTP, FTPS, SFTP front endPartners upload by FTP into S3 / EFS
DataSyncScheduled syncMigrate or sync file data, keep metadata
Snow FamilyPhysical deviceHuge data, slow or no network, edge compute
DatabasesIndexed, queryableData you need to search and query
Exam quick recall

Sync on-prem NFS to EFS every night, keeping permissions?

DataSync with an agent on-prem.

Copy data from EFS to S3 once a day?

DataSync, no agent needed between AWS services.

Partners must keep using SFTP, but you want the files in S3?

AWS Transfer Family.

DataSync vs Storage Gateway?

DataSync migrates or syncs on a schedule. Storage Gateway gives on-prem apps ongoing, cached access to cloud storage.

Check yourself

  1. You must sync an on-prem NFS share to Amazon EFS every night and keep file permissions. Which service?
  2. DataSync needs an agent to copy data between two AWS storage services, such as EFS to S3.
  3. DataSync can write directly into Glacier storage classes.
  4. Partners can only send files by SFTP, but you want them stored in S3. Which service?
  5. Where can AWS Transfer Family store uploaded files?
  6. What is the main difference between DataSync and Storage Gateway?
  7. Many Linux EC2 instances in several AZ need one shared file system. Which service?
  8. A site has 500 TB to move and only a slow internet link. What is the best fit?
  9. Which identity sources can AWS Transfer Family use for user logins?
  10. Which storage service gives block storage for a single EC2 instance, locked to one AZ?

Take the quiz on Brainbotox

Chapter 18: Decoupling with SQS, SNS, Kinesis and Amazon MQ

Decoupling means putting a buffer between parts of an app, so one part can slow down, fail or scale without breaking the others.

Queue
SQS
Pub / sub
SNS
Real time streaming
Kinesis
Open protocols
Amazon MQ

SQS, Simple Queue Service

Standard queue

  • Oldest AWS service. Fully managed, unlimited throughput and unlimited messages in the queue.
  • Retention: 4 days by default, 14 days max. Latency under 10 ms.
  • Max message size: 1 MiB (older material says 256 KB). Bigger payloads: store in S3, send a pointer.
  • At least once delivery (duplicates possible) and best effort ordering (out of order possible).
  • Consumers poll up to 10 messages at a time, process them, then delete them.
  • Scale consumers with an ASG driven by the CloudWatch metric ApproximateNumberOfMessages.
  • Security: HTTPS in flight, KMS at rest, IAM, and SQS access policies (like bucket policies) for cross-account access or to let S3 / SNS write to the queue.

Key settings

SettingWhat it does
Visibility timeoutOnce polled, a message is hidden from other consumers for 30 s by default. Not deleted in time: it reappears. Consumer can call ChangeMessageVisibility for more time.
Long pollingConsumer waits 1 to 20 s for messages to arrive. Fewer API calls, lower latency and cost. Preferred over short polling.
Dead letter queueAfter MaximumReceives failures, the message goes to a DLQ for debugging. Then redrive it back to the source queue.
Delay queueHide new messages for 0 to 15 min before consumers see them.

FIFO queue

  • Ordered and exactly once processing (deduplication). Name must end in .fifo.
  • Limited throughput: 300 msg/s, 3,000 msg/s with batching (high throughput mode goes higher).
  • Ordering per Message Group ID: one consumer per group, so more groups means more parallelism.
  • The DLQ of a FIFO queue must also be FIFO.
Web tier ASG→ SendMessage →SQS→ poll →Worker ASG→RDS / S3

Classic exam pattern: SQS as a buffer in front of a database so no write is lost during a traffic spike.

SNS, Simple Notification Service

  • Publish once, many subscribers receive it (pub/sub).
  • Up to 12,500,000 subscriptions per topic, 100,000 topics per account.
  • Subscribers: SQS, Lambda, Kinesis Data Firehose, HTTP(S), email, SMS, mobile push.
  • Many AWS services publish to SNS: CloudWatch alarms, ASG notifications, S3 events, CloudFormation...
  • Security like SQS: HTTPS, KMS, IAM, SNS access policies.
  • Message filtering: a JSON filter policy per subscription, so each subscriber only gets matching messages.
  • FIFO topics: ordering and dedup, subscribers can be SQS FIFO or SQS standard.

Fan-out pattern: SNS + SQS

Producer→SNS topic→SQS queue A+SQS queue B+...
  • Fully decoupled, no data loss (queues persist), add subscribers any time.
  • The queue access policy must allow SNS to write.
  • Use case: one S3 event rule (event type + prefix) can only have one destination, so send it to SNS and fan out to many queues.
  • Works cross-region too.

Kinesis

Kinesis Data Streams (KDS)

  • Collect and store real time streaming data: clickstreams, IoT, logs, metrics.
  • Retention up to 365 days, so data can be replayed. Data can't be deleted until it expires.
  • Records up to 1 MB. Ordering per partition key (same key goes to same shard).
  • Capacity: provisioned (each shard: 1 MB/s or 1,000 records/s in, 2 MB/s out) or on-demand (scales automatically).
  • Consumers: Lambda, KCL apps, Firehose, Managed Service for Apache Flink.

Amazon Data Firehose (Kinesis Data Firehose)

  • Fully managed, serverless, loads streaming data into destinations: S3, Redshift (via S3 COPY), OpenSearch, Splunk, any HTTP endpoint, partners like Datadog.
  • Near real time because it buffers (by size or time).
  • Can transform with Lambda, convert to Parquet / ORC, compress. Failed data goes to a backup S3 bucket.
  • No storage, no replay.
Data StreamsFirehose
PurposeStore and process streamsDeliver streams to a destination
ManagementYou write producers and consumersFully managed
LatencyReal timeNear real time
Storage / replayUp to 365 days, replay yesNone

Ordering: SQS FIFO vs Kinesis

100 trucks send GPS data, order needed per truck:

  • Kinesis: partition key = truck ID. Parallelism = number of shards (5 shards, 5 consumers).
  • SQS FIFO: Message Group ID = truck ID. Parallelism = number of groups (up to 100 consumers), no shards to manage.

Amazon MQ

  • Managed RabbitMQ and ActiveMQ.
  • For apps using open protocols: MQTT, AMQP, STOMP, OpenWire, WSS. Migrate on-prem messaging without rewriting the app to SQS / SNS.
  • Runs on servers, doesn't scale like SQS / SNS. Has both queues and topics.
  • High availability: Multi-AZ with active / standby failover (ActiveMQ uses EFS as shared storage).
Exam quick recall

Messages are processed twice. What to check?

Visibility timeout too short; raise it or call ChangeMessageVisibility.

Reduce empty receives and API cost on SQS?

Long polling (WaitTimeSeconds 1 to 20).

Strict order and no duplicates?

SQS FIFO.

One event must go to several independent processing apps?

SNS + SQS fan-out.

Real time stream that must be replayed later?

Kinesis Data Streams.

Load streaming data into S3 or Redshift with no code?

Amazon Data Firehose.

Migrate an app that uses AMQP or MQTT?

Amazon MQ.

Check yourself

  1. A message is processed twice by different consumers of a standard SQS queue. What is the most likely cause?
  2. What is the default and maximum message retention of an SQS queue?
  3. How do you reduce the number of empty responses and API calls when consumers poll SQS?
  4. What is the throughput of an SQS FIFO queue with batching (standard mode)?
  5. One S3 upload event must be processed by three independent applications. Which pattern?
  6. Streaming data must be stored for 30 days and replayed by new consumers. Which service?
  7. You want to load streaming data into S3 as Parquet with no code to manage. Which service?
  8. An on-prem app uses AMQP and MQTT. You want to move it to AWS without rewriting it. Which service?
  9. With SQS FIFO, how do you keep ordering per customer while processing different customers in parallel?
  10. Amazon Data Firehose delivers data in real time with no buffering.

Take the quiz on Brainbotox

Chapter 19: Containers on AWS: ECS, Fargate, ECR, EKS and App Runner

A container (Docker) packages an app with everything it needs, so it runs the same everywhere. AWS gives you several ways to run them.

ECS
AWS's own orchestrator
EKS
Managed Kubernetes
Fargate
Serverless compute for both
ECR
Image registry

Amazon ECS, Elastic Container Service

You launch ECS tasks (running containers) on an ECS cluster. Two launch types:

EC2 launch typeFargate launch type
ServersYou provision and maintain EC2 instances (each runs the ECS agent)Serverless, no instances to manage
You defineTask definitions + instance capacityTask definitions with CPU and RAM
ScalingScale tasks and instancesJust increase the number of tasks

IAM roles

  • EC2 instance profile (EC2 launch type only): used by the ECS agent to call ECS, send logs to CloudWatch, pull images from ECR, read secrets.
  • ECS task role: gives each task its own permissions (task A reads S3, task B writes DynamoDB). Defined in the task definition.

Load balancing and storage

  • ALB for most cases, NLB for very high throughput or with PrivateLink.
  • Persistent shared storage: EFS mounted into tasks, works with EC2 and Fargate. Fargate + EFS = fully serverless.
  • S3 cannot be mounted as a file system in a task.

Auto scaling

  • ECS Service Auto Scaling (via Application Auto Scaling): target tracking on CPU, memory or ALB request count per target, step scaling, scheduled scaling.
  • EC2 launch type also needs more instances: use an ASG, or better an ECS Cluster Capacity Provider that adds instances when tasks lack room.

Common patterns

S3 upload→ EventBridge →run ECS task (Fargate)→DynamoDB
EventBridge schedule→ every hour →batch ECS task
SQS queue→ polled by →ECS service, scales on queue length

Amazon ECR, Elastic Container Registry

  • Store and manage Docker images on AWS, private or public (ECR Public Gallery).
  • Integrated with ECS and EKS, images stored on S3 behind the scenes.
  • Access controlled by IAM (permission errors = check the policy).
  • Image vulnerability scanning, versioning, tags, lifecycle policies.

Amazon EKS, Elastic Kubernetes Service

  • Managed Kubernetes (open source, cloud agnostic). Choose it when a company already uses Kubernetes or wants to move between clouds.
  • Node types:
    • Managed node groups: AWS creates and manages EC2 nodes in an ASG (on-demand or spot).
    • Self-managed nodes: you build and manage them yourself.
    • Fargate: no nodes at all.
  • Storage: a StorageClass with a CSI driver: EBS, EFS (the one that works with Fargate), FSx for Lustre, FSx for NetApp ONTAP.

AWS App Runner

  • Fully managed: deploy a web app or API from source code or a container image, no infrastructure knowledge needed.
  • Builds, deploys, auto scales, gives you HTTPS, load balancing, encryption, VPC access.
  • Use case: get a web app or microservice live fast.
Exam quick recall

Run containers without managing servers?

ECS or EKS with Fargate.

Each container needs different AWS permissions?

ECS task roles, one per task definition.

Shared persistent storage for Fargate tasks?

EFS.

Company already runs Kubernetes on-prem?

EKS.

Scale the EC2 instances behind ECS automatically?

ECS Cluster Capacity Provider.

Simplest way to deploy a containerised web app?

App Runner.

Check yourself

  1. You want to run containers on AWS without provisioning or managing any EC2 instances. Which option?
  2. Two ECS tasks need different AWS permissions (one reads S3, one writes DynamoDB). What do you use?
  3. Fargate tasks need a shared persistent file system. Which storage?
  4. Which component automatically adds EC2 instances to an ECS cluster when tasks lack capacity?
  5. Your company already runs Kubernetes on-prem and wants the same tooling on AWS. Which service?
  6. Which metrics can ECS Service Auto Scaling track?
  7. Where do you store private Docker images on AWS?
  8. Which EKS node type is fully managed by AWS as EC2 instances in an Auto Scaling Group?
  9. You want to deploy a containerised web app from source code with no infrastructure knowledge. Which service?
  10. How do you run an ECS task each time a file is uploaded to S3?

Take the quiz on Brainbotox

Chapter 20: Serverless part 1: AWS Lambda and DynamoDB

Serverless means you don't manage servers: you deploy code or data and AWS handles capacity, scaling and patching. Lambda runs the code, DynamoDB stores the data.

AWS Lambda

  • Run functions on demand, triggered by events. Scales automatically. Pay per request and per compute time (GB-seconds).
  • Free tier: 1M requests and 400,000 GB-s per month.
  • Runtimes: Node.js, Python, Java, .NET, Ruby, custom runtime. Also container images (must implement the Lambda Runtime API).
  • More RAM also gives more CPU and network.
  • Triggers: API Gateway, S3, DynamoDB Streams, SQS, SNS, Kinesis, EventBridge, Cognito, CloudFront...

Limits to know (per region)

LimitValue
Memory128 MB to 10 GB
Max execution time15 minutes (longer: use ECS, Fargate, Batch)
Environment variables4 KB
/tmp disk512 MB to 10 GB
Concurrency1,000 executions (can be raised)
Deployment package50 MB zipped, 250 MB unzipped; container image up to 10 GB

Concurrency and cold starts

  • Reserved concurrency: cap a function so it can't eat all 1,000 and throttle other functions.
  • Throttled: synchronous calls get a 429 error; async calls retry, then go to a DLQ.
  • Cold start: a new instance loads code and runs init, so the first request is slow.
  • Fix: provisioned concurrency (instances kept warm) or SnapStart (Java, Python, .NET: snapshot of the initialised function).

Lambda in a VPC

  • By default Lambda runs outside your VPC. Attach it to your VPC (subnets + security group) to reach RDS, ElastiCache, internal ALB: Lambda creates an ENI.
  • Internet from a VPC Lambda needs a NAT Gateway (public subnet doesn't help).
  • Many Lambdas opening DB connections: use RDS Proxy (Lambda must be in the VPC).
  • RDS for PostgreSQL and Aurora MySQL can invoke Lambda from inside the database (e.g. on insert).

Edge functions: CloudFront Functions vs Lambda@Edge

CloudFront FunctionsLambda@Edge
LanguageJavaScriptNode.js, Python
ScaleMillions of requests/sThousands of requests/s
TriggersViewer request / response onlyViewer + origin request / response
Max timeUnder 1 ms5 s (viewer) / 30 s (origin)
Network / body accessNoYes
Use forHeader changes, URL rewrites, cache keys, JWT checksLonger logic, 3rd party libraries, calling other services

Amazon DynamoDB

  • Fully managed, serverless NoSQL database, replicated across 3 AZ. Millions of requests per second, single digit millisecond latency.
  • Made of tables. Each item has a primary key: partition key alone, or partition key + sort key.
  • Max item size 400 KB. Flexible schema: add attributes any time.
  • IAM for security, no SQL joins.

Capacity modes

ModeHowPick when
Provisioned (default)Set RCU / WCU, optional auto scalingPredictable traffic, cheaper
On-demandPay per request, scales instantlyUnpredictable or spiky traffic

Features

  • DAX: in-memory cache for DynamoDB, microsecond reads, no app changes. (ElastiCache is better to cache aggregated computed results.)
  • DynamoDB Streams: ordered stream of item changes, 24 h retention, processed by Lambda. Or send changes to Kinesis Data Streams for up to 1 year retention.
  • Global tables: multi-region, active-active (read and write in any region). Needs Streams enabled.
  • TTL: items expire and are deleted automatically (sessions, old data).
  • Backups: point in time recovery up to 35 days, on-demand backups, or AWS Backup (cross-region).
  • Export to S3 (needs PITR, no read capacity used) and import from S3.
  • Table classes: Standard, or Standard-IA for rarely accessed data.
DynamoDB change→ Streams →Lambda→SNS / OpenSearch / another table
Exam quick recall

Job runs 40 minutes. Lambda?

No, 15 min max. Use ECS / Fargate or AWS Batch.

First request after idle is slow on Lambda?

Cold start: provisioned concurrency or SnapStart.

VPC Lambda can't reach the internet?

Route through a NAT Gateway.

Lambda floods RDS with connections?

RDS Proxy.

Simple header rewrite at the edge for millions of requests?

CloudFront Functions.

DynamoDB reads need microsecond latency?

DAX.

Users in several regions must write to the same table?

DynamoDB global tables.

Spiky, unpredictable traffic on a new table?

On-demand capacity mode.

Check yourself

  1. What is the maximum execution time of a Lambda function?
  2. Users complain the first request after a quiet period is slow on your Java Lambda. What helps?
  3. A Lambda function attached to your VPC must call a public internet API. What does it need?
  4. How do you stop one Lambda function from using all the account's concurrency?
  5. You need to rewrite headers at the edge for millions of requests per second, in under a millisecond. Which option?
  6. What is the maximum size of a DynamoDB item?
  7. DynamoDB reads must have microsecond latency without changing application logic. What do you add?
  8. Users in Europe and Asia must both write to the same DynamoDB table with low latency. Which feature?
  9. A new app has unpredictable, spiky traffic. Which DynamoDB capacity mode fits best?
  10. How long can DynamoDB point in time recovery restore back to?

Take the quiz on Brainbotox

Chapter 21: Serverless part 2: API Gateway, Step Functions, Cognito and serverless architectures

API Gateway puts a front door on your functions, Step Functions chains them into workflows, Cognito handles your users. Together with Lambda and DynamoDB they make a full serverless app.

Amazon API Gateway

  • Serverless way to create REST and WebSocket APIs. Lambda + API Gateway = no infrastructure at all.
  • Handles versioning and stages (dev, test, prod), API keys, request throttling, caching of responses, request validation and transformation, import from Swagger / OpenAPI.
  • Integrations: Lambda, any HTTP backend (on-prem, ALB), or an AWS service directly (start a Step Functions run, send to SQS, put a record in Kinesis).
  • Default integration timeout: 29 seconds.

Endpoint types

TypeMeaning
Edge-optimized (default)Requests routed through CloudFront edge locations; API still lives in one region. For global clients.
RegionalClients in the same region (you can add your own CloudFront in front).
PrivateOnly reachable from your VPC through an interface VPC endpoint, controlled by a resource policy.

Security

  • Authentication: IAM roles (internal apps), Cognito user pools (your app's users), or a Lambda authorizer (your own logic, e.g. a 3rd party token).
  • Custom domain with HTTPS through ACM: for edge-optimized the certificate must be in us-east-1; for regional, in the API's region.

AWS Step Functions

  • Build a visual serverless workflow (a state machine) to orchestrate Lambda functions and other services.
  • Features: sequence, parallel steps, conditions, timeouts, error handling and retries, human approval steps.
  • Integrates with Lambda, ECS, Batch, DynamoDB, SQS, SNS, EMR, Glue, API Gateway and many more.
  • Use case: order processing, data pipelines, any multi-step business process.

Amazon Cognito

Gives users of your web or mobile app an identity (they are not IAM users).

Cognito User PoolsCognito Identity Pools
PurposeSign in for app usersGive users temporary AWS credentials
HowServerless user directory: username or email + password, MFA, password reset, social login (Google, Facebook), SAML / OIDCUsers from a user pool or a 3rd party login get an IAM role
ResultA JWT tokenDirect access to S3, DynamoDB... with IAM policies
Integrates withAPI Gateway, ALBAny AWS service the IAM role allows
  • Identity pools support row level security in DynamoDB: a policy variable on the user's ID so each user only reads their own items.

Serverless architectures to recognise

Mobile app (for example a to-do list)

Mobile app→ login →Cognito→ REST + token →API Gateway→Lambda→DAX cache→DynamoDB
  • API Gateway verifies the user's token with Cognito before calling Lambda.
  • Files: the app uses Cognito temporary credentials to read and write files in S3 directly, without going through API Gateway. An IAM policy limits each user to their own files.
  • High read throughput: put a DAX cache in front of DynamoDB.
  • Static, repeated responses: cache them at the API Gateway level, so Lambda isn't even called.

Serverless website (a blog with static content)

Users→ nearest edge location →CloudFront→ OAC →S3 (static pages)
  • OAC (Origin Access Control): the S3 bucket policy only allows CloudFront, so nobody can read the bucket directly.
Users→ REST →API Gateway→Lambda→DAX→DynamoDB

Send a welcome email to new users

DynamoDB table→ stream changes →DynamoDB Streams→Lambda (IAM role allows SES)→Amazon SES
  • The Lambda function needs an IAM role that allows it to use SES (Simple Email Service).

Picture management (thumbnails)

User uploads photos→CloudFront (global)→ OAC →S3→ event trigger →Lambda→ thumbnail →S3
  • Uploads go through CloudFront edge locations, or use S3 Transfer Acceleration, so users far away upload faster.

Microservices

  • Each microservice exposes a REST API and has its own code and architecture: each one can be designed the way you want.
  • Users find each service through Route 53 (DNS).
ServiceFront doorComputeData
Service 1Elastic Load BalancingECSDynamoDB
Service 2API GatewayLambdaElastiCache
Service 3ELBEC2RDS

Two communication patterns

Synchronous
API Gateway, load balancers
Asynchronous
SQS, Kinesis, SNS, Lambda triggers (S3 events)

Distributing software updates with CloudFront

The problem: an app on EC2 distributes software updates once in a while. When a new version comes out, all clients ask for it at the same time. That huge burst of requests makes the Auto Scaling group scale out a lot, which is costly in CPU and network.

Clients→CloudFront→ASG: EC2 in AZ 1, AZ 2, AZ 3→EFS (holds the update files)

Why CloudFront is the answer

  • No change in the architecture: just put CloudFront in front.
  • It caches the update files at edge locations around the world.
  • Updates are static, not dynamic, so they cache perfectly.
  • EC2 is not serverless, but CloudFront is, and scales for you.
  • The ASG won't have to scale out much: big savings on EC2, plus on availability and network bandwidth cost.
Overall, CloudFront is an easy way to make an existing application more scalable and cheaper.
Exam quick recall

Serverless REST API in front of Lambda?

API Gateway.

API only reachable from inside the VPC?

Private API Gateway endpoint with an interface VPC endpoint.

Edge-optimized API with a custom domain: where's the certificate?

ACM in us-east-1.

Multi-step workflow with retries and a human approval?

Step Functions.

App users sign in, get a JWT?

Cognito User Pools.

App users upload directly to S3 with temporary credentials?

Cognito Identity Pools.

DynamoDB reads are too heavy?

Add DAX (and cache static responses in API Gateway).

S3 bucket must only be readable through CloudFront?

Origin Access Control (OAC) and a bucket policy that only allows CloudFront.

Thousands of clients download the same update from EC2 at once?

Put CloudFront in front: static files cached at the edge, the ASG barely scales.

Asynchronous links between microservices?

SQS, SNS, Kinesis, Lambda triggers.

Check yourself

  1. Which are API Gateway endpoint types?
  2. Your API must only be reachable from inside your VPC. Which endpoint type?
  3. An edge-optimized API Gateway uses a custom domain. Where must the ACM certificate be?
  4. Which can authenticate requests to API Gateway?
  5. You need a workflow that chains several Lambda functions with retries, branches and a human approval step. Which service?
  6. Mobile app users must sign in with email and password, with optional Google login, and receive a JWT. Which service?
  7. App users must upload photos directly to S3 using temporary AWS credentials. Which service?
  8. Each user of your app should only read their own items in a DynamoDB table. How?
  9. What is the default integration timeout of API Gateway?
  10. You want to send a welcome email when a new user row is inserted in DynamoDB. Which pattern?
  11. An app on EC2 in an Auto Scaling group distributes software updates. Every release, all clients download at once and the ASG scales out a lot, which is costly. What is the simplest fix with no change to the architecture?
  12. Your static website lives in S3 behind CloudFront. How do you make sure users can't read the bucket directly?
  13. Which of these are asynchronous ways for microservices to communicate?

Take the quiz on Brainbotox

Chapter 22: Data and analytics: Athena, Redshift, OpenSearch, EMR, Glue, QuickSight and MSK

The exam gives you a data need (query logs, build a warehouse, search, dashboards, ETL, streaming) and expects you to pick the right analytics service.

Amazon Athena

  • Serverless SQL queries directly on files in S3 (built on Presto / Trino). Pay per TB scanned (about $5 per TB).
  • Formats: CSV, JSON, ORC, Avro, Parquet. Commonly used with QuickSight for reporting and dashboards.
  • Use cases: analytics, reporting, business intelligence, ad hoc queries, log analysis (VPC Flow Logs, ELB logs, CloudTrail logs).

Make Athena faster and cheaper

  • Use columnar formats (Apache Parquet, ORC): huge performance improvement and far less data scanned. Use Glue to convert your data to Parquet or ORC.
  • Compress data (gzip, bzip2...).
  • Partition datasets in S3 so queries can filter on virtual columns: s3://yourBucket/pathToTable/columnName=value/columnName=value/, for example s3://bucket/year=2026/month=11/.
  • Use larger files (128 MB and more): fewer, bigger files are cheaper to scan than many tiny ones.

Federated Query

  • Query data outside S3 with SQL: relational, non-relational, object and custom data sources (DynamoDB, RDS, on-prem databases, other clouds).
  • Works through data source connectors that run as Lambda functions; results can be stored in S3.

Amazon Redshift

  • Database based on PostgreSQL, but not for OLTP (Online Transaction Processing): it is for OLAP (Online Analytical Processing), so it is used for analytics and data warehousing.
  • About 10x better performance than other data warehouses, scales to petabytes of data.
  • Columnar storage of data plus a parallel query engine, with a SQL interface for queries.
  • Two modes: provisioned cluster or Redshift Serverless.
  • Vs Athena: faster for complex queries, joins and aggregations, thanks to indexes, but you must load the data in first.

Inside a cluster

Leader node
plans queries, aggregates results
Compute nodes
run the queries, send results to the leader
  • Provisioned: you choose the instance types in advance, and can reserve instances for cost savings.

Snapshots and disaster recovery

  • Redshift has Multi-AZ mode for some cluster types (RA3); otherwise a cluster lives in one AZ.
  • Snapshots are point in time backups stored in S3.
  • They are incremental: only what changed since the last snapshot is saved.
  • You can restore a snapshot into a new cluster.
  • Automated snapshots: every 8 hours, every 5 GB of changes, or on a schedule (with a retention period). Manual snapshots are kept until you delete them.
  • Redshift can copy snapshots to another region automatically for DR.

Loading data (ingestion)

Kinesis Data Firehose→Redshift
S3→ COPY command →Redshift
EC2 instance→ JDBC driver →Redshift
  • S3 COPY can use enhanced VPC routing so the data stays off the internet.
  • From EC2 with JDBC, insert in large batches: row by row is very inefficient.

Redshift Spectrum

  • Analyse data in S3 without loading it into Redshift first.
  • You need a Redshift cluster to start the query; the query is then submitted to thousands of Spectrum nodes, which read the data in S3. A lot more processing power.
SQL query→Redshift cluster→thousands of Spectrum nodes→ read →S3

Amazon OpenSearch Service

  • Successor of Elasticsearch. Search any field, partial matches, unlike DynamoDB which queries by key.
  • Managed cluster or serverless. Ingest from Firehose, IoT, CloudWatch Logs.
  • Classic pattern: keep data in DynamoDB, use DynamoDB Streams → Lambda → OpenSearch to make it searchable, then fetch the full item from DynamoDB.

Amazon EMR

  • Managed Hadoop clusters (Spark, HBase, Presto, Flink...) on hundreds of EC2 instances for big data.
  • Use cases: data processing, ML, web indexing, big data.
  • Nodes: master (on-demand or reserved), core (stores data, long running: reserved), task (just compute: spot).

Glue, Lake Formation and QuickSight

AWS Glue

  • Serverless ETL (extract, transform, load). Example: S3 upload → Glue job converts CSV to Parquet → Athena queries it.
  • Glue Data Catalog: crawlers discover your data and store table definitions, used by Athena, Redshift Spectrum and EMR.
  • Job Bookmarks (don't reprocess old data), Glue DataBrew (clean data with no code), Glue Studio (visual jobs), Glue Streaming ETL (from Kinesis or MSK).

AWS Lake Formation

  • Build a data lake in days, on top of Glue. Blueprints to ingest from S3, RDS, on-prem.
  • Centralised, fine-grained access control (row and column level) for all apps reading the lake.

Amazon QuickSight

  • Serverless BI dashboards. SPICE in-memory engine for imported data.
  • Sources: RDS, Aurora, Athena, Redshift, S3, OpenSearch, SaaS apps...
  • Users and groups are QuickSight users, not IAM. Column level security in Enterprise edition.

Streaming: MSK and Managed Service for Apache Flink

Kinesis Data StreamsAmazon MSK (managed Kafka)
Message size1 MB1 MB default, configurable higher (e.g. 10 MB)
UnitShards (split, merge)Topics with partitions (add only)
RetentionUp to 365 daysAs long as you want (EBS storage)
EncryptionTLS in flight, KMS at restPlaintext or TLS in flight, KMS at rest
  • MSK: brokers spread over multiple AZ, or MSK Serverless. Pick it when the team already uses Kafka.
  • Managed Service for Apache Flink: real time processing of streams from Kinesis Data Streams or MSK (not Firehose).

Big data ingestion pipeline

IoT devices→Kinesis Data Streams→Firehose→S3→Athena / Redshift→QuickSight
Exam quick recall

Serverless SQL on S3 logs?

Athena (use Parquet + partitions to cut cost).

Athena must also query DynamoDB or an on-prem database?

Federated Query with Lambda data source connectors.

Complex analytics with joins on loaded data?

Redshift.

Which Redshift node plans the query and aggregates results?

The leader node; compute nodes run the query.

Query huge data in S3 from Redshift without loading it?

Redshift Spectrum.

Load data into Redshift from EC2?

JDBC driver, in large batches (or better: S3 COPY).

Full text search across item fields?

OpenSearch.

Hadoop / Spark cluster?

EMR.

Convert CSV to Parquet serverlessly?

Glue ETL.

Row and column level permissions on a data lake?

Lake Formation.

Dashboards for business users?

QuickSight.

Company already uses Kafka?

Amazon MSK.

Check yourself

  1. You need to run SQL queries on CloudTrail logs stored in S3 without managing servers. Which service?
  2. Which steps reduce Athena cost and improve performance?
  3. Athena must also query data in DynamoDB and an on-prem database. Which feature?
  4. Which service is a columnar data warehouse for OLAP analytics?
  5. How do you protect a Redshift cluster against a regional disaster?
  6. In a provisioned Redshift cluster, which node plans the query and aggregates the results?
  7. You want Redshift to query a huge dataset stored in S3 without loading it into the cluster. What do you use?
  8. Redshift snapshots are incremental: only what changed since the last snapshot is saved.
  9. Users must search products by any field with partial matches. Data lives in DynamoDB. What do you add?
  10. Which EMR node type is best run on spot instances?
  11. Which service gives row and column level access control across a data lake?
  12. Your team already runs Apache Kafka and wants a managed version on AWS. Which service?
  13. Which sources can Managed Service for Apache Flink read from?

Take the quiz on Brainbotox

Chapter 23: Choosing an AWS database: DocumentDB, Neptune, Keyspaces and Timestream

Many exam questions describe a type of data (transactions with joins, JSON documents, a social graph, sensor readings over time) and expect you to pick the matching AWS database. Learn the database types first, then the specialised NoSQL engines.

Database types and the AWS service for each

TypeAWS servicesPick it for
Relational (RDBMS), SQL, OLTPRDS, AuroraTransactions, structured data, great for joins
NoSQLDynamoDB (JSON), ElastiCache (key/value), Neptune (graphs), DocumentDB (MongoDB), Keyspaces (Cassandra)Flexible schema, massive scale. No joins, no SQL
Object storeS3, S3 GlacierBig files, backups, data lakes, archives
Data warehouseRedshift (OLAP), Athena, EMRSQL analytics and business intelligence (BI)
SearchOpenSearch (JSON documents)Free text and unstructured search
GraphAmazon NeptuneShowing relationships between data
LedgerAmazon Quantum Ledger Database (QLDB)Immutable, verifiable history of changes
Time seriesAmazon TimestreamPoints with a timestamp and a value (metrics, IoT)
QLDB reached end of support on 31 July 2025, so it can no longer be created. You may still see it in older practice questions as the answer for "ledger".

Amazon DocumentDB

  • AWS implementation of MongoDB: a NoSQL database that stores, queries and indexes JSON documents.
  • Works like Aurora: fully managed, highly available with data replicated across 3 AZ, storage grows automatically in 10 GB steps.
  • Exam keyword: "MongoDB" points to DocumentDB.

Amazon Neptune

  • Fully managed graph database.
  • For highly connected datasets, for example a social network: users have friends, posts have comments, comments have likes. A graph database makes queries on those relationships fast.
  • Other uses: knowledge graphs (like Wikipedia), fraud detection, recommendation engines.

Neptune Streams

  • A real time, ordered sequence of every change to your graph data.
  • Changes are available immediately after writing, with no duplicates and in strict order.
  • Read through an HTTP REST API. Uses: send notifications when data changes, keep a copy in OpenSearch or ElastiCache, replicate to another region.
Neptune→ every change →Neptune Streams→ REST API →Your app / Lambda

Amazon Keyspaces (for Apache Cassandra)

  • Managed Apache Cassandra, an open source NoSQL distributed database.
  • Serverless, scalable, highly available, fully managed. Tables scale up and down automatically with traffic; data is replicated 3 times across multiple AZ.
  • Queries use CQL (Cassandra Query Language).
  • Capacity: on-demand or provisioned with auto scaling. Use cases: IoT device data, time series data.

Amazon Timestream

  • Fully managed, serverless time series database: each point is a time and one or more values (CPU usage per minute, temperature from a sensor).
  • Faster and cheaper than storing this kind of data in a relational SQL database.
  • Recent data is kept in memory, older data is moved to a cost optimised storage tier automatically.
  • SQL compatible queries and built-in time series functions. Use cases: IoT, operational monitoring, real time analytics.
Since 20 June 2025, Timestream for LiveAnalytics (the original serverless engine) is closed to new customers; AWS recommends Timestream for InfluxDB for new workloads. For the exam, "time series" still means Timestream.
Exam quick recall

Transactions with complex joins?

RDS or Aurora.

Migrate a MongoDB app to a managed AWS database?

DocumentDB.

Social network, friends of friends, relationships?

Neptune.

React to every change in a graph, in order?

Neptune Streams.

Managed Apache Cassandra, CQL queries?

Amazon Keyspaces.

Sensor readings or metrics with timestamps?

Timestream.

Free text search on JSON documents?

OpenSearch.

SQL analytics and BI on large data?

Redshift (or Athena directly on S3).

Check yourself

  1. You are building a social network and need fast queries on friends, posts, comments and likes. Which database?
  2. A company wants to move its MongoDB application to a fully managed AWS database. Which service?
  3. Your team runs Apache Cassandra and wants a serverless managed version on AWS. Which service?
  4. Which query language does Amazon Keyspaces use?
  5. Thousands of IoT sensors send a temperature reading every minute. You need a serverless store that is cheaper and faster than a relational database for this. Which service?
  6. What does Neptune Streams give you?
  7. An application needs transactions and complex joins across several tables. Which service fits best?
  8. Which of these are NoSQL databases?
  9. Users need free text search over unstructured JSON documents. Which service?
  10. In Amazon Timestream, recent data is kept in memory and older data is moved automatically to a cheaper storage tier.

Take the quiz on Brainbotox

Chapter 24: Machine learning services: Rekognition, Transcribe, Polly, Comprehend, SageMaker and more

For the Architect Associate you don't build models: you only need to match each managed AI service to its use case. Most are "send data, get a result" APIs with no ML knowledge needed.

Images, video and documents

ServiceWhat it doesExample
RekognitionFind objects, people, text, scenes in images and videos; facial analysis and search; content moderationFlag inappropriate images on a social app, count people in a store video
TextractExtract text, handwriting, forms and tables from scanned documentsRead invoices, ID documents, tax forms

Speech and language

ServiceWhat it doesExample
TranscribeSpeech to text; can redact personal data automatically, detect languageSubtitles, call centre transcripts
PollyText to speech; lexicons (custom pronunciation) and SSML (pauses, emphasis)Talking apps, audio articles
TranslateNatural language translationLocalise a website or reviews
ComprehendNLP: find language, key phrases, entities, sentiment, topics in textAnalyse customer emails and reviews
Comprehend MedicalExtract health information from clinical text (HIPAA eligible)Doctor's notes, prescriptions
LexBuild chatbots with voice and text (same tech as Alexa)Booking bot on a website
ConnectCloud contact centre; pairs with Lex for virtual agentsCustomer service phone line

Search, recommendations, forecasting

ServiceWhat it doesExample
KendraML powered document search across your files (natural language questions)"Where is the IT support desk?" answered from internal docs
PersonalizeReal time personalised recommendations (same tech as amazon.com)Product suggestions, "you may also like"
ForecastTime series forecastingPredict next quarter's sales or demand

Build your own: SageMaker

  • Fully managed service for data scientists to build, train and deploy their own ML models.
  • Pick it when the question says "custom model", "train", "data scientists".
  • Amazon Bedrock: managed access to foundation models for generative AI apps.
Exam quick recall

Detect unsafe images or faces in photos?

Rekognition.

Turn audio into text?

Transcribe. Text into audio? Polly.

Sentiment of customer reviews?

Comprehend.

Extract fields from scanned forms?

Textract.

Chatbot?

Lex (plus Connect for a call centre).

Search internal documents in natural language?

Kendra.

Product recommendations?

Personalize.

Train a custom model?

SageMaker.

Check yourself

  1. A social app must automatically detect inappropriate content in uploaded photos. Which service?
  2. You need subtitles generated from video audio. Which service?
  3. Your app must read articles aloud with a natural voice. Which service?
  4. Which service finds the sentiment (positive or negative) of customer reviews?
  5. You must extract fields and tables from scanned invoices. Which service?
  6. Which service builds voice and text chatbots?
  7. Employees want to ask natural language questions and get answers from internal documents. Which service?
  8. An online shop wants real time product recommendations. Which service?
  9. Data scientists need to build, train and deploy their own models. Which service?
  10. Which service predicts future values such as next quarter's product demand?

Take the quiz on Brainbotox

Chapter 25: Monitoring and audit: CloudWatch, EventBridge, CloudTrail and AWS Config

Four services, four questions: how is it performing (CloudWatch), what should react to it (EventBridge), who did what (CloudTrail), and is it configured correctly (Config).

CloudWatch
metrics, logs, alarms
EventBridge
react to events
CloudTrail
API call history
Config
configuration compliance

Amazon CloudWatch

Metrics

  • Metrics for every service, grouped in namespaces, with dimensions (instance ID, environment...).
  • EC2: every 5 min by default, 1 min with detailed monitoring (paid).
  • RAM, disk space and processes are not default EC2 metrics: install the CloudWatch Unified Agent (config can be stored in SSM Parameter Store).
  • Custom metrics with PutMetricData, standard (1 min) or high resolution (1, 5, 10, 30 s).
  • Metric Streams: send metrics in near real time to Firehose or a partner (Datadog, Splunk...).

Logs

  • Log groups (one per app) and log streams (one per instance or container). Retention: 1 day to 10 years, or never expire.
  • Sources: SDK, Unified Agent, Beanstalk, ECS, Lambda, VPC Flow Logs, API Gateway, CloudTrail, Route 53 queries.
  • Logs Insights: query language to search and aggregate logs.
  • Export to S3: batch only, can take up to 12 h. For real time use subscription filters to Kinesis Data Streams, Firehose, Lambda or OpenSearch.
  • Cross-account and cross-region aggregation via subscription filters. Logs encrypted with KMS.

Alarms

  • States: OK, INSUFFICIENT_DATA, ALARM. Evaluated over a period.
  • Actions: EC2 (stop, terminate, reboot, recover), Auto Scaling, SNS (and so anything).
  • EC2 instance recovery: on a status check failure, the instance moves to new hardware and keeps the same private IP, public IP, Elastic IP, metadata and placement group.
  • Composite alarms: combine alarms with AND / OR to reduce noise.
  • Test with set-alarm-state.

Insights

  • Container Insights (ECS, EKS, Fargate), Lambda Insights, Contributor Insights (top N talkers, e.g. heaviest IPs), Application Insights.

Amazon EventBridge (formerly CloudWatch Events)

  • Schedule (cron) jobs: run a Lambda every hour.
  • Event pattern rules: react to service events, e.g. root user signs in → SNS email.
  • Targets: Lambda, SQS, SNS, Step Functions, ECS tasks, Kinesis, CodePipeline, API destinations...
  • Event buses: default (AWS services), partner (SaaS like Zendesk, Datadog), custom (your apps).
  • Archive and replay events, schema registry.
  • Resource-based policies: accept events from other accounts, e.g. one central bus for the whole organisation.

AWS CloudTrail

  • History of API calls in your account (console, SDK, CLI, services): who did what, when, from where. Enabled by default.
  • Event history kept 90 days. Longer: send a trail to S3 (query with Athena) or CloudWatch Logs.
  • A trail can cover all regions (default) or one.
Event typeContentLogged by default?
Management eventsOperations on resources (create bucket, attach policy, create subnet)Yes
Data eventsS3 object level (GetObject, PutObject), Lambda invokesNo (high volume)
CloudTrail InsightsUnusual activity: bursts of calls, hitting limitsNo (paid option)
User deletes a DynamoDB table→ CloudTrail →EventBridge rule→SNS alert

AWS Config

  • Records the configuration of resources and its changes over time, and checks them against rules for compliance.
  • Managed rules (75+) or custom rules (Lambda). Examples: is SSH open to the world? are buckets public? is every EBS volume encrypted?
  • Evaluated on every change or on a schedule. Config doesn't prevent actions (no deny).
  • Remediation: SSM Automation documents fix non-compliant resources automatically (with retries).
  • Notifications through EventBridge or SNS. Per region, can be aggregated across regions and accounts.

Which one? Example with a load balancer

ServiceWhat it tells you about the ELB
CloudWatchIncoming connections, error codes, latency; alarm and dashboard
ConfigSecurity group rule history, config changes, is SSL always on?
CloudTrailWho changed the ELB through the API, and when
Exam quick recall

Monitor EC2 memory usage?

Install the CloudWatch Unified Agent (custom metric).

Stream logs in real time to OpenSearch or Lambda?

CloudWatch Logs subscription filter (export to S3 is batch).

Instance fails a status check: same IPs on new hardware?

CloudWatch alarm with the EC2 recover action.

Run a Lambda every night?

EventBridge schedule rule.

Who deleted the bucket?

CloudTrail.

Audit and auto-fix non-compliant security groups?

AWS Config rule + SSM Automation remediation.

Check yourself

  1. You need to monitor RAM usage on EC2 instances. What do you do?
  2. How often are default EC2 metrics sent to CloudWatch, and with detailed monitoring?
  3. Logs must reach OpenSearch in near real time. Which CloudWatch Logs feature?
  4. An instance fails a system status check. You want it moved to new hardware keeping the same IPs. What do you use?
  5. Which feature combines several alarms with AND / OR to reduce alert noise?
  6. You want an email every time the root user signs in. What do you build?
  7. How long does CloudTrail keep events in its event history by default?
  8. CloudTrail logs S3 object level operations (data events) by default.
  9. You must check that no security group allows SSH from anywhere, and fix it automatically. Which service?
  10. AWS Config rules prevent non-compliant changes from happening.

Take the quiz on Brainbotox

Chapter 26: Advanced IAM: Organizations, SCPs, permission boundaries, Identity Center and Control Tower

Once a company has many AWS accounts and many people, it needs central control: who can log in where, and what no one is ever allowed to do.

AWS Organizations

  • Manage many AWS accounts from one management account; the others are member accounts (each in only one organisation).
  • Group accounts in Organizational Units (OU): by business unit, environment (prod, dev) or project.
  • Consolidated billing: one bill, and pooled usage for volume discounts; Reserved Instances and Savings Plans discounts are shared across accounts.
  • API to create accounts automatically. Other policies: tag policies, backup policies.

Service Control Policies (SCP)

  • Guardrails: the maximum permissions allowed in an OU or account. They don't grant anything by themselves.
  • Apply to every user and role of member accounts, including their root user.
  • Do not apply to the management account.
  • By default FullAWSAccess is attached. Strategies: deny list (allow all, deny some) or allow list.
  • Explicit deny anywhere in the hierarchy (root, OU, account) wins.
  • Example: deny everything outside eu-west-1, deny turning off CloudTrail, deny leaving the organisation.

IAM conditions to know

Condition keyUse
aws:SourceIpDeny calls not coming from your company's IP range
aws:RequestedRegionRestrict actions to some regions
ec2:ResourceTag / aws:PrincipalTagAllow actions only on resources with a matching tag (ABAC)
aws:MultiFactorPresentRequire MFA for sensitive actions
aws:PrincipalOrgIDIn a bucket policy: only accounts of your organisation can access
  • S3 detail: s3:ListBucket applies to arn:aws:s3:::bucket, while s3:GetObject applies to arn:aws:s3:::bucket/*.

Role vs resource-based policy (cross-account)

  • Assuming a role: you give up your original permissions and only have the role's.
  • Resource-based policy (S3 bucket, SQS, SNS, Lambda...): you keep your own permissions. Better when you need to read in account A and write in account B.
  • EventBridge targets: Lambda, SNS, SQS, S3, API Gateway use resource-based policies; Kinesis, ECS tasks, SSM Run Command use an IAM role.

Permission boundaries and policy evaluation

  • A permission boundary is a managed policy that sets the maximum permissions an IAM user or role can get (not groups).
  • Effective permissions = intersection of SCP, permission boundary and identity policy.
  • Use case: let developers create their own roles without escalating to admin.

Evaluation order (simplified)

Explicit deny anywhere?→ deny
SCP allows?→Resource policy allows?→Identity policy allows?→Boundary allows?→Session policy allows?→ allow

Anything not explicitly allowed is denied (implicit deny).

IAM Identity Center and Directory Services

AWS IAM Identity Center (successor to AWS SSO)

  • One login for all accounts of the organisation, business apps (Salesforce, Microsoft 365...), SAML 2.0 apps and EC2 Windows instances.
  • Identity source: built-in store, or Active Directory, Okta, OneLogin...
  • Permission sets define what a user gets in which account. Supports ABAC with user attributes.

AWS Directory Services

OptionWhat it is
AWS Managed Microsoft ADA real AD in AWS; can trust your on-prem AD; MFA
AD ConnectorA proxy that sends auth to your on-prem AD; users stay on-prem
Simple ADAD compatible, standalone in AWS; cannot join on-prem AD

AWS Control Tower

  • Sets up a secure multi-account environment in a few clicks, following best practices. Runs on top of Organizations.
  • Automates account setup, monitors compliance in a dashboard.
  • Controls (guardrails): preventive (implemented with SCPs), detective (implemented with AWS Config), proactive (checks before deployment).
Exam quick recall

Block every account in an OU from using a service, even their root user?

An SCP on the OU.

Do SCPs restrict the management account?

No.

Bucket accessible only by accounts in our organisation?

Bucket policy with aws:PrincipalOrgID.

Let developers create roles but never exceed set permissions?

Permission boundaries.

One sign-in to all accounts and SaaS apps?

IAM Identity Center.

Use on-prem AD users without syncing them to AWS?

AD Connector.

Quick, governed multi-account landing zone?

Control Tower.

Check yourself

  1. You want to prevent all accounts in the Dev OU from launching resources outside eu-west-1, including their root users. What do you use?
  2. Service Control Policies restrict the management account of the organisation.
  3. An S3 bucket must be readable only by accounts in your AWS Organization. Which condition?
  4. What is the main benefit of consolidated billing in Organizations?
  5. Developers may create IAM roles, but those roles must never exceed a set of permissions. What do you use?
  6. A user in account A must read from a bucket in account B and write to a bucket in account A at the same time. Best approach?
  7. Employees need one login for all AWS accounts in the organisation and for Microsoft 365. Which service?
  8. You want to authenticate AWS users against your on-prem Active Directory without storing users in AWS. Which option?
  9. In AWS Control Tower, how are detective controls implemented?
  10. An identity policy allows s3:DeleteObject, but an SCP on the account explicitly denies it. Result?

Take the quiz on Brainbotox

Chapter 27: Encryption and security: KMS, Secrets Manager, ACM, WAF, Shield, GuardDuty, Inspector and Macie

Encryption protects data in flight (TLS) and at rest (KMS keys). The security services then protect, detect and report: firewalls, DDoS protection and threat detection.

AWS KMS, Key Management Service

  • AWS manages encryption keys for you. Integrated with IAM, and every key use is logged in CloudTrail.
  • Used by EBS, S3, RDS, SSM, Secrets Manager... Never store secrets in plain text in code.
  • Key types: symmetric (AES-256, one key, never leaves KMS, used through the API) and asymmetric (RSA / ECC pair, public key can be downloaded to encrypt outside AWS).
Key ownershipCostRotation
AWS owned keysFreeManaged by AWS (used by SSE-S3, SSE-SQS, DynamoDB default)
AWS managed keys (aws/rds, aws/ebs...)FreeAutomatic, every year
Customer managed keys$1 / monthAutomatic (configurable) or on demand
Imported key material$1 / monthManual only
  • Plus about $0.03 per 10,000 API calls.
  • Keys are regional. Copying an encrypted EBS snapshot to another region: it is re-encrypted with a key in the new region.
  • Key policies: without one allowing access, nobody can use the key. Default policy gives the account access, then IAM decides. Custom policies for cross-account.
  • Share an encrypted snapshot or AMI with another account: share it, and allow that account in the key policy.
  • Multi-region keys: same key ID and material replicated in several regions, so data encrypted in one can be decrypted in another (global client-side encryption, DynamoDB global tables, Aurora Global).
  • S3 replication of SSE-KMS objects must be enabled explicitly, with the target key and the right permissions.

Storing secrets: Parameter Store vs Secrets Manager

SSM Parameter StoreSecrets Manager
StoresConfiguration and secrets, in a hierarchy (/my-app/dev/db-url)Secrets (passwords, API keys)
EncryptionOptional, KMSAlways, KMS
RotationNo native rotationAutomatic rotation every X days (Lambda)
IntegrationCloudFormation, versioning, notificationsNative with RDS, Aurora, Redshift, DocumentDB
Multi-regionNoReplicas in other regions, promotable for DR
CostStandard tier freeAbout $0.40 / secret / month

AWS Certificate Manager (ACM)

  • Provision and manage TLS certificates for HTTPS. Public certificates are free and renew automatically.
  • Works with ELB (ALB, NLB), CloudFront and API Gateway. Not on EC2 directly (the certificate can't be extracted).
  • Validation: DNS (CNAME record, preferred, needed for auto renewal) or email.
  • Imported certificates don't auto renew: ACM sends expiry events from 45 days before (EventBridge), and Config has a rule to check expiry.
  • Certificate region: CloudFront and edge-optimized API Gateway need us-east-1; others need the resource's region.

Protecting apps: WAF, Shield and Firewall Manager

AWS WAF, Web Application Firewall

  • Protects against layer 7 (HTTP) exploits. Deploy on ALB, API Gateway, CloudFront, AppSync, Cognito user pools. Not on NLB.
  • Web ACL rules: IP sets, headers, body, URI strings, SQL injection, cross-site scripting (XSS), size limits, geo match, rate-based rules (count requests per IP, for DDoS).
  • Web ACLs are regional, except for CloudFront (global).
  • Need a fixed IP plus WAF? NLB doesn't support WAF: use Global Accelerator (fixed IPs) → ALB with WAF.

AWS Shield

  • Shield Standard: free, automatic, against layer 3 / 4 attacks (SYN / UDP floods, reflection).
  • Shield Advanced: about $3,000 / month per organisation. Protects EC2, ELB, CloudFront, Global Accelerator, Route 53. 24/7 Shield Response Team, cost protection for scaling spikes during attacks, automatic layer 7 mitigation with WAF rules.

AWS Firewall Manager

  • Manage security rules across all accounts of an organisation: WAF rules, Shield Advanced, security groups, Network Firewall, Route 53 Resolver DNS Firewall.
  • Rules apply automatically to new resources (e.g. every new ALB in any account).

Detecting threats: GuardDuty, Inspector, Macie

ServiceWhat it does
GuardDutyIntelligent threat detection with ML on CloudTrail, VPC Flow Logs and DNS logs (optional: EKS, RDS logins, S3, EBS, Lambda). Finds e.g. cryptocurrency mining, compromised instances. Findings go to EventBridge.
InspectorAutomated vulnerability scanning of EC2 instances (via SSM agent: OS packages, network reachability), ECR container images and Lambda functions. Risk score per finding.
MacieUses ML to find sensitive data (PII) in S3 buckets and alert you.
Exam quick recall

Audit every use of an encryption key?

KMS (logged in CloudTrail).

Copy an encrypted snapshot to another region?

Re-encrypt with a KMS key in the target region.

Database password rotated automatically?

Secrets Manager.

Free, auto-renewing HTTPS certificate on an ALB?

ACM public certificate.

Block SQL injection and rate-limit IPs?

WAF on ALB, API Gateway or CloudFront.

DDoS support team and cost protection?

Shield Advanced.

Same WAF rules on every account in the organisation?

Firewall Manager.

Detect crypto mining on EC2?

GuardDuty. Scan for CVEs? Inspector. Find PII in S3? Macie.

Check yourself

  1. You copy an encrypted EBS snapshot from eu-west-1 to us-east-1. What happens to encryption?
  2. Which KMS key type costs about $1 per month and supports automatic rotation you configure?
  3. An RDS database password must be rotated automatically every 30 days. Which service?
  4. You can install an ACM public certificate directly on an EC2 instance.
  5. In which region must the ACM certificate be for a CloudFront distribution?
  6. You must block SQL injection attempts on your web app behind an ALB. Which service?
  7. Your app sits behind an NLB and needs WAF protection with fixed IPs. What do you do?
  8. What does Shield Advanced add over Shield Standard?
  9. Which service uses ML on CloudTrail, VPC Flow Logs and DNS logs to detect threats like crypto mining?
  10. You must discover personal data stored in S3 buckets. Which service?

Take the quiz on Brainbotox

Chapter 28: VPC part 1: CIDR, subnets, gateways, NAT, NACLs, peering and endpoints

A VPC (Virtual Private Cloud) is your own private network in an AWS region. VPC is one of the heaviest topics on the exam.

CIDR and private IP ranges

  • A CIDR is a base IP plus a mask that says how many addresses: /32 = 1 IP, /24 = 256, /16 = 65,536, 0.0.0.0/0 = all IPs.
  • Each smaller number doubles the count: /27 = 32, /26 = 64, /25 = 128.
  • Private ranges: 10.0.0.0/8, 172.16.0.0/12 (default VPC uses 172.31.0.0/16), 192.168.0.0/16.

VPC and subnets

  • Every account has a default VPC per region with a public subnet in each AZ: new instances get a public IPv4.
  • Max 5 VPCs per region (soft limit). Up to 5 CIDRs per VPC, each between /28 (16 IPs) and /16 (65,536 IPs).
  • Use private ranges only, and don't overlap with your other networks (e.g. corporate).
  • A subnet lives in one AZ. Public subnet = has a route to an internet gateway. Private subnet = no direct route.
AWS reserves 5 IPs in every subnet (first 4 and last 1): .0 network, .1 VPC router, .2 DNS, .3 future use, .255 broadcast.
Need 29 IPs? /27 gives 32 - 5 = 27, not enough. Pick /26 (64 - 5 = 59).

Getting to the internet

Internet Gateway (IGW)

  • Lets resources in a VPC reach the internet. Scales horizontally, highly available. One VPC = one IGW.
  • Alone it does nothing: the route table must send 0.0.0.0/0 → IGW.

Bastion host

  • EC2 in a public subnet used to SSH into private instances. Its security group allows port 22 only from your company's public IP range. Private instances allow SSH from the bastion's security group.
  • Modern alternative: SSM Session Manager (no port 22 at all).

NAT: private instances reaching the internet (outbound only)

Private subnet EC2→NAT Gateway (public subnet)→IGW→Internet
NAT GatewayNAT instance (legacy)
Managed byAWSYou (EC2 with a NAT AMI)
AvailabilityHA within one AZ: create one per AZ for fault toleranceScript failover yourself
Bandwidth5 Gbps, scales up to 100 GbpsDepends on instance type
Security groupsNone to manageYou manage them
SetupElastic IP, in a public subnetElastic IP, disable source / destination check
Bastion?NoYes, possible

NACL vs security group

Security groupNetwork ACL
LevelInstance (ENI)Subnet
RulesAllow onlyAllow and deny
StateStateful: return traffic auto allowedStateless: return traffic must be allowed explicitly
EvaluationAll rulesIn order, lowest number first, first match wins
  • NACL rules numbered 1 to 32,766, last rule * denies. Default NACL allows everything; a new custom NACL denies everything.
  • Great to block a specific IP at subnet level (security groups can't deny).
  • Ephemeral ports (1024 to 65535): clients answer on random ports, so NACLs must allow them in both directions.

VPC peering and VPC endpoints

VPC peering

  • Privately connects two VPCs over the AWS network, so they act as one. Works cross-account and cross-region.
  • CIDRs must not overlap. Not transitive: A↔B and B↔C does not give A↔C.
  • Update the route tables in each VPC. You can reference a peered VPC's security group (same region).

VPC endpoints (PrivateLink)

Reach AWS services privately, without an IGW or NAT.

Gateway endpointInterface endpoint
ServicesS3 and DynamoDB onlyMost services (and S3)
HowTarget in the route tableAn ENI with a private IP; needs a security group
CostFreePer hour + per GB
Prefer whenUsually the answer for S3 / DynamoDBAccess needed from on-prem (VPN / DX), another VPC or region
  • Not working? Check the VPC's DNS resolution and DNS hostnames settings, and route tables.

VPC Flow Logs

  • Capture IP traffic info at VPC, subnet or ENI level (also ELB, RDS, NAT Gateway, Transit Gateway...).
  • Send to S3, CloudWatch Logs or Firehose; query with Athena or Logs Insights.
  • Fields: srcaddr, dstaddr, srcport, dstport, action (ACCEPT / REJECT).
  • Troubleshooting: inbound REJECT → NACL or security group. Inbound ACCEPT but outbound REJECT → NACL (stateless).
Exam quick recall

How many usable IPs in a /28 subnet?

16 - 5 = 11.

Private instances need to download patches from the internet?

NAT Gateway in a public subnet (one per AZ for HA).

NAT instance not forwarding traffic?

Disable the source / destination check.

Block one attacker IP for a whole subnet?

NACL deny rule.

VPC A peers with B, B with C. Can A reach C?

No, peering isn't transitive.

Private EC2 reaching S3 with no internet and no cost?

Gateway VPC endpoint.

Check yourself

  1. How many IP addresses does AWS reserve in each subnet?
  2. You need at least 29 usable IP addresses in a subnet. What is the smallest subnet size?
  3. Instances in a private subnet must download updates from the internet but never accept inbound connections. What do you use?
  4. How do you make NAT Gateways fault tolerant?
  5. A NAT instance doesn't forward any traffic. What setting is often forgotten?
  6. Which statements about Network ACLs are true?
  7. You must block one malicious IP address for an entire subnet. What do you use?
  8. VPC A is peered with B, and B with C. Can A talk to C?
  9. EC2 instances in a private subnet must access S3 privately at no extra cost. Which option?
  10. Flow Logs show inbound traffic ACCEPTED but the response REJECTED outbound. What is the likely cause?

Take the quiz on Brainbotox

Chapter 29: VPC part 2: Site-to-Site VPN, Direct Connect, Transit Gateway, IPv6, Network Firewall and network costs

How to connect your VPCs to your offices and data centres, connect many VPCs together, and keep network costs down.

AWS Site-to-Site VPN

  • An encrypted IPsec tunnel over the public internet between your network and a VPC. Quick to set up.
  • Virtual Private Gateway (VGW): the AWS side, attached to the VPC (custom ASN possible).
  • Customer Gateway (CGW): your side, a software or hardware device. Use its public IP, or the public IP of the NAT device in front of it.
  • Enable route propagation for the VGW in your route tables. To ping instances from on-prem, allow ICMP in the security group.
  • VPN CloudHub: connect several sites to the same VGW, hub and spoke, so sites can also talk to each other through the VPN. Low cost.
Corporate data centre (CGW)⇄ IPsec over internet ⇄VGW⇄VPC

AWS Direct Connect (DX)

  • A dedicated private connection from your network to AWS through a Direct Connect location. Doesn't use the internet.
  • Use cases: high bandwidth, cheaper large transfers, consistent network performance, hybrid environments.
  • Reaches public resources (S3) and private ones (EC2) on the same connection. IPv4 and IPv6.
  • Direct Connect Gateway: one DX to VPCs in many regions.
Connection typeCapacity
Dedicated1, 10, 100 Gbps (and higher) physical port, requested from AWS then set up by partners
Hosted50 Mbps up to 10 Gbps and more, through an AWS partner; capacity can change on demand
Lead time is often more than a month. Need it next week? Use a Site-to-Site VPN.
DX traffic is private but not encrypted: run a VPN over Direct Connect for IPsec encryption.

Resiliency

  • High: one connection at each of two DX locations.
  • Maximum: two connections on separate devices at each of two or more locations.
  • Cheap backup: a Site-to-Site VPN used if the DX fails.

AWS Transit Gateway

  • Hub and spoke connecting thousands of VPCs and on-prem networks. Transitive, unlike VPC peering.
  • Regional; peer Transit Gateways across regions. Share across accounts with Resource Access Manager (RAM).
  • Route tables control which VPC can talk to which.
  • Works with Direct Connect Gateway and VPN connections.
  • Only AWS service that supports IP multicast.
  • ECMP (equal cost multi path): several Site-to-Site VPN connections to one Transit Gateway to multiply VPN bandwidth (each tunnel about 1.25 Gbps).
VPC A+VPC B+VPC C+VPN / DX⇄Transit Gateway

IPv6, egress-only gateway, traffic mirroring

  • Every IPv6 address is public. You can't disable IPv4 in a VPC; IPv6 runs as dual stack.
  • Can't launch an EC2 in a dual stack subnet? It's not IPv6: the subnet has no IPv4 left. Add a new IPv4 CIDR.
  • Egress-only Internet Gateway: like a NAT Gateway but for IPv6: instances can go out, the internet can't come in. Route ::/0 → EIGW.
  • Traffic Mirroring: copy ENI traffic to an ENI or NLB for inspection (threat detection, troubleshooting).

AWS Network Firewall

  • Protects a whole VPC from layer 3 to layer 7, in every direction: VPC to VPC, to and from the internet, to and from DX / VPN.
  • Rules: IP and port filtering, protocol filtering, domain lists (allow only *.mycompany.com outbound), regex pattern matching. Actions allow, drop, alert. Intrusion prevention.
  • Built on Gateway Load Balancer. Managed centrally across accounts with Firewall Manager. Logs to S3, CloudWatch Logs, Firehose.

Network costs (rough numbers)

TrafficCost per GB
Into AWS (ingress)Free
Between EC2 in the same AZ, private IPFree
Between AZ, private IPAbout $0.01 each way
Between AZ, public / Elastic IPAbout $0.02 each way
Between regionsAbout $0.02
S3 to internetAbout $0.09
S3 to CloudFrontFree (CloudFront to internet is a bit cheaper than S3)
NAT GatewayHourly fee + about $0.045 per GB processed
Gateway endpoint to S3Free
  • Use private IPs, keep chatty traffic in one AZ (trading off HA), use gateway endpoints instead of NAT for S3 / DynamoDB, keep processing inside AWS to cut egress.
Exam quick recall

Encrypted on-prem connection needed this week?

Site-to-Site VPN.

Consistent, high bandwidth private link?

Direct Connect (plan for a month+ lead time).

Encrypt Direct Connect traffic?

VPN over Direct Connect.

Cheap backup if DX fails?

Site-to-Site VPN.

Connect hundreds of VPCs and on-prem transitively?

Transit Gateway.

More VPN bandwidth?

Transit Gateway with ECMP over several VPN connections.

IPv6 instances must reach out but not be reachable?

Egress-only Internet Gateway.

Filter outbound traffic by domain for a whole VPC?

AWS Network Firewall.

Check yourself

  1. You need an encrypted connection between your data centre and a VPC, working within days. What do you use?
  2. Which components does a Site-to-Site VPN need?
  3. Direct Connect traffic must be encrypted. What do you do?
  4. What is a cost effective backup for a Direct Connect connection?
  5. One Direct Connect connection must reach VPCs in several regions. What do you add?
  6. You must connect 200 VPCs and on-prem networks with transitive routing. Which service?
  7. How do you increase bandwidth of Site-to-Site VPN connections to AWS?
  8. Which AWS service supports IP multicast?
  9. IPv6 instances must initiate outbound connections but never accept inbound ones from the internet. What do you use?
  10. Which EC2 to EC2 traffic is free?

Take the quiz on Brainbotox

Chapter 30: Disaster recovery and migration: RPO, RTO, DR strategies, DMS, AWS Backup and MGN

Disaster recovery (DR) is how fast you come back and how much data you lose after a failure. Migration is moving servers and databases into AWS with as little downtime as possible.

RPO and RTO

  • RPO, Recovery Point Objective: how much data you can lose. The time between the last backup or replication and the disaster.
  • RTO, Recovery Time Objective: how long you can be down. The time between the disaster and being back online.
  • Smaller RPO and RTO = more expensive.
Last backup← RPO →Disaster← RTO →Back online

The 4 DR strategies (cheapest and slowest first)

StrategyHowRPO / RTO
Backup and restoreBack up to AWS (snapshots, S3, Storage Gateway, Snowball). Rebuild everything after a disaster.Hours / hours. Cheapest.
Pilot lightOnly the critical core (e.g. the database, replicated) runs in AWS. Start the rest on disaster.Minutes / tens of minutes.
Warm standbyThe full system runs at minimum size. Scale up to production on disaster (ASG, Route 53 failover).Seconds to minutes / minutes.
Multi-site / hot siteFull production scale running in both places, active-active.Near zero / near zero. Most expensive.

DR tips

  • Backups: EBS snapshots, RDS automated backups, S3 lifecycle to IA / Glacier, Cross Region Replication.
  • HA: Route 53 to move DNS between regions, RDS Multi-AZ, ElastiCache Multi-AZ, EFS, S3. Site-to-Site VPN as backup for Direct Connect.
  • Replication: RDS cross-region read replicas, Aurora Global Database, Storage Gateway.
  • Automation: CloudFormation or Beanstalk to rebuild, CloudWatch alarms to recover EC2.
  • Chaos testing: AWS Fault Injection Service.

AWS DMS, Database Migration Service

  • Migrate databases to AWS quickly and securely. The source database stays available during the migration.
  • Homogeneous (Oracle → Oracle) or heterogeneous (SQL Server → Aurora) migrations.
  • Continuous replication with CDC (change data capture) to keep the target in sync until cut-over.
  • Runs replication tasks on an EC2 replication instance (or DMS Serverless). Multi-AZ option: synchronous standby replica.
  • Sources: on-prem / EC2 databases (Oracle, SQL Server, MySQL, MariaDB, PostgreSQL, MongoDB, SAP, DB2), Azure SQL, RDS, Aurora, S3, DocumentDB.
  • Targets: databases, RDS, Aurora, Redshift, DynamoDB, S3, OpenSearch, Kinesis, Kafka, DocumentDB, Neptune, Redis.

AWS SCT, Schema Conversion Tool

  • Converts the schema from one engine to another (Oracle → PostgreSQL, Teradata → Redshift).
  • Not needed when the engine stays the same (on-prem PostgreSQL → RDS PostgreSQL).

Into Aurora

  • RDS MySQL → Aurora MySQL: restore a snapshot as Aurora (some downtime), or create an Aurora read replica of the RDS DB and promote it (less downtime).
  • External MySQL → Aurora: Percona XtraBackup to S3, then create Aurora from S3 (or mysqldump, slower).
  • Both databases up and running: use DMS.

Migrating servers

  • AWS Application Discovery Service: gathers info about on-prem servers to plan a migration. Agentless (VM inventory, CPU, memory, disk) or agent-based (processes, network connections, dependencies). Tracked in Migration Hub.
  • AWS Application Migration Service (MGN): lift and shift (rehost) physical, virtual or cloud servers to AWS. Continuous replication to a low-cost staging area, then a quick cut-over with minimal downtime.
  • VM Import / Export: import VM images as AMIs. VMware Cloud on AWS: run vSphere workloads on AWS.

AWS Backup

  • Fully managed, central backups across services: EC2 / EBS, S3, RDS, Aurora, DynamoDB, DocumentDB, Neptune, EFS, FSx, Storage Gateway volumes.
  • Cross-region and cross-account backups, point in time recovery for supported services, tag-based policies.
  • Backup plans: frequency, backup window, move to cold storage, retention.
  • Backup Vault Lock: WORM (write once, read many). Backups can't be deleted, even by the root user.

Moving a lot of data: how long?

Example: 200 TB to move. 200 TB = 1,600,000,000 Mb.

MethodTime
Internet, 100 Mbps1,600,000,000 ÷ 100 = 16,000,000 s ≈ 185 days
Direct Connect, 1 Gbps≈ 18.5 days, plus over a month to set it up
Snowball (2 or 3 in parallel)About 1 week end to end

Ongoing replication after the bulk move: Site-to-Site VPN or DX with DMS or DataSync.

Exam quick recall

Cheapest DR, hours of downtime acceptable?

Backup and restore.

Only the database replicated, the rest started on demand?

Pilot light.

Scaled-down full copy running, scale up on failure?

Warm standby.

Near zero RTO, cost no issue?

Multi-site active-active.

Migrate Oracle to Aurora PostgreSQL with the source still live?

SCT for the schema + DMS with CDC.

Lift and shift hundreds of on-prem servers?

Application Migration Service (MGN).

Backups no one can delete, not even root?

AWS Backup Vault Lock.

Check yourself

  1. What does RPO measure?
  2. Which DR strategy keeps only the critical core (like a replicated database) running in AWS?
  3. A full copy of the system runs at minimum size and scales up on disaster. Which strategy?
  4. Which DR strategy gives the lowest RTO and RPO at the highest cost?
  5. You migrate Oracle to Aurora PostgreSQL while the source stays in use. What do you use?
  6. You need the Schema Conversion Tool to migrate on-prem PostgreSQL to RDS for PostgreSQL.
  7. What is the least downtime way to move RDS MySQL to Aurora MySQL?
  8. You need to rehost hundreds of on-prem servers on AWS with minimal downtime. Which service?
  9. Backups must be impossible to delete, even by the root user. What do you enable?
  10. About how long does it take to send 200 TB over a 100 Mbps internet link?

Take the quiz on Brainbotox

Chapter 31: Other services and the Well-Architected Framework: CloudFormation, Systems Manager, cost tools, Batch, HPC

The last batch of services that show up in exam questions, and the six pillars that every answer is judged against.

AWS CloudFormation

  • Infrastructure as code: describe resources in a YAML or JSON template; CloudFormation creates them as a stack, in the right order.
  • Benefits: no manual work, version control, cost tags per stack, delete and recreate environments (e.g. dev off at night), reuse templates.
  • Service role: an IAM role CloudFormation uses to create resources, so users only need iam:PassRole (least privilege).
  • StackSets: deploy one stack to many accounts and regions at once.

AWS Systems Manager (SSM)

FeatureWhat it does
Session ManagerShell into EC2 and on-prem servers without SSH, port 22, keys or a bastion. Needs the SSM agent and an IAM role. Sessions logged to S3 / CloudWatch.
Run CommandRun a script or command on a whole fleet, no SSH. Output to S3 / CloudWatch, can be triggered by EventBridge.
Patch ManagerAutomate OS and app patching on EC2 and on-prem, on demand or on a schedule, with compliance reports.
Maintenance WindowsSchedule when actions (patches, scripts) run.
AutomationRunbooks for common tasks: restart instances, create AMIs, snapshot EBS. Triggered manually, by EventBridge, Maintenance Windows or AWS Config remediation.
Parameter StoreConfiguration and secrets (see chapter 27).

Cost management tools

ToolUse it to
Cost ExplorerVisualise costs over time, build reports, forecast future spend, get Savings Plan recommendations
Cost Anomaly DetectionML spots unusual spending and alerts you, with root cause
AWS BudgetsAlerts (SNS, email) when cost, usage or reservation use passes a threshold; Budget Actions can act automatically
Compute OptimizerML right-sizing recommendations for EC2, ASG, EBS, Lambda, ECS on Fargate, RDS
Trusted AdvisorChecks across cost, performance, security, fault tolerance, service limits. Full checks need Business or Enterprise support
Instance SchedulerAWS solution to stop / start EC2 and RDS on a schedule (e.g. outside office hours)

More services to recognise

  • Amazon SES: send (and receive) emails at scale: transactional, marketing, bulk. DKIM and SPF, reputation dashboard, bounce and open stats.
  • Amazon Pinpoint: 2-way marketing campaigns over email, SMS, push, voice, with segments and templates. AWS is retiring its campaign features; SMS and push live on as AWS End User Messaging. Can still appear in questions.
  • AWS Outposts: AWS racks installed in your own data centre, running EC2, EBS, S3, EKS, ECS, RDS, EMR. For low latency, local data processing, data residency. You handle physical security.
  • AWS AppFlow: transfer data between SaaS apps (Salesforce, SAP, Zendesk, Slack) and AWS (S3, Redshift), on a schedule, on event or on demand.
  • AWS Amplify: build and deploy full-stack web and mobile apps (auth, storage, API, CI/CD), "Beanstalk for web and mobile apps".

AWS Batch vs Lambda

LambdaAWS Batch
Time limit15 minNone
RuntimeSupported runtimesAny, packaged as a Docker image
Disk/tmp up to 10 GBEBS or instance store
ComputeServerlessManaged EC2 or spot (or Fargate)

High Performance Computing (HPC) on AWS

  • Data in: Direct Connect, Snowball, DataSync.
  • Compute: compute or GPU optimised EC2, spot fleets, cluster placement group (lowest latency).
  • Networking: ENA (enhanced networking, up to 100 Gbps), EFA (Elastic Fabric Adapter): ENA for tightly coupled HPC on Linux, uses MPI and bypasses the OS for very low latency.
  • Storage: EBS io2 Block Express, instance store, S3, EFS, FSx for Lustre.
  • Automation: AWS Batch, AWS ParallelCluster (open source tool to deploy HPC clusters, can enable EFA).

AWS Well-Architected Framework: the 6 pillars

Operational excellence
run, monitor, improve
Security
protect data and systems
Reliability
recover, scale, avoid failure
Performance efficiency
right resources, keep up with demand
Cost optimisation
no waste
Sustainability
reduce environmental impact
  • They work together, they are not trade-offs to pick between.
  • Principles: stop guessing capacity, test at production scale, automate, allow evolutionary architectures, decide with data, practise with game days.
  • Well-Architected Tool: free, review your workloads against the pillars and get advice.
Exam quick recall

Same infrastructure in 10 accounts and 3 regions?

CloudFormation StackSets.

Shell access with no SSH and no open ports?

SSM Session Manager.

Patch a fleet of EC2 and on-prem servers on a schedule?

SSM Patch Manager + Maintenance Windows.

Get alerted when spend goes over a threshold?

AWS Budgets.

Right-size over-provisioned instances?

Compute Optimizer.

Batch job running 6 hours in a Docker image?

AWS Batch.

Run AWS services in your own data centre?

Outposts.

Tightly coupled HPC needing the lowest latency between nodes?

EFA + cluster placement group.

Check yourself

  1. You must deploy the same CloudFormation stack to 10 accounts across 3 regions. Which feature?
  2. How can users deploy CloudFormation stacks without having direct permissions on every resource?
  3. Security wants shell access to EC2 with no SSH keys, no port 22 and no bastion. Which feature?
  4. Which tool gives ML-based right-sizing recommendations for EC2, EBS and Lambda?
  5. You want an email when this month's spend is forecast to exceed $1,000. Which service?
  6. A batch job runs 6 hours inside a Docker image. Which service fits best?
  7. Regulations require data to stay in your own data centre, but you want AWS services and APIs there. Which option?
  8. Which network option suits tightly coupled HPC workloads on Linux with MPI?
  9. Which are pillars of the AWS Well-Architected Framework?
  10. You need to sync Salesforce data into S3 every hour without writing code. Which service?

Take the quiz on Brainbotox