Find it useful? Give it a star
Find it useful? Give it a star

AWS SAA-C03 Architecture & Services Handbook

IAM

AWS Global Infrastructure fundamentals

1. Concept

AWS divides its infrastructure into Regions, each containing multiple Availability Zones, so you can choose where applications run.

2. Purpose

Understand where AWS places resources to choose the right deployment location, reduce latency, and avoid service outages when problems occur.

3. How it works

Region and Availability Zone

  • Region: A geographic area containing AWS infrastructure, such as Singapore.
  • Availability Zone (AZ): One or more data centers with independent power and connectivity; each Region has multiple AZs.
  • AZ connectivity: AZs in a Region are connected with low-latency networks.
  • Resource scope: EC2, EBS, and subnets belong to one AZ; other services may have Regional or global scope.

Multi-AZ and Multi-Region

  • Multi-AZ: Runs an application across AZs in one Region. Another AZ can keep serving after a failure if enough resources and protected data remain.
  • Multi-Region: Runs across Regions to serve geographically distributed users or recover from a whole-Region failure.
  • Example: Two AZs in Singapore protect against one AZ failing; add another Region for recovery from a Singapore-wide incident.
  • Trade-off: Multiple Regions cost more and require an appropriate data replication strategy.
User → Load Balancer
                ├─ EC2 is in AZ A
                └─ EC2 in AZ B

Select Region

  • Consider the user's location, what country the data request must be in, whether the service needed is available and the cost.
  • Edge location is used to bring content/services closer to users; not an AZ to place EC2 yourself.
  • AZ names like ap-southeast-1a may map differently between accounts.
  • When you need to compare the same physical location between accounts, use AZ ID.

4. Practical example

A store runs in Singapore across two AZs to withstand an AZ failure.

The website needs to tolerate one data center: ALB and EC2/ASG across at least two AZs, the database has Multi-AZ. Global application needs to recover when Region fails: add DR architecture in another Region.

5. Comparison

A Region is a geographic area; an AZ is a fault domain within it; an Edge Location brings content closer to users.

IAM identities: Root, Users & Groups

1. Concept

IAM controls who can access AWS and what each identity can do with its resources.

2. Purpose

Determine who is using AWS and manage the rights of each person in the account.

3. How it works

AWS account and root user

ConceptNature & Scope
AWS AccountThe isolation unit contains resources and billing on AWS
Root UserThe account's special identity has very broad permissions, only used for tasks that require root privileges
  • Turn on MFA for root, protect recovery information, do not create root access keys and do not use root for daily work.
  • Do not treat the root user as a way to bypass all protection mechanisms: SCP and some mechanisms such as S3 Object Lock Compliance can still limit operations.

IAM Users and Groups

IAM IdentityFeatures & Rules
IAM UserLong-term identity; can have password (to Console) and/or access key (API/CLI call — two separate credential types)
IAM GroupGroup IAM Users to grant common permissions; A user can belong to many groups, but the group cannot nest another group and does not contain an IAM Role
Group Developers → policy allows viewing EC2
                 ├─ User An
                 └─ User Binh

Login for employees

  • Prioritize IAM Identity Center or federation: employees log in and receive access to roles with temporary credentials.
  • No need to create and share long-term access keys for each person.
  • If using IAM User, log in with account ID/alias, user name and password.
  • Each session only has permissions for the identity/role in use.

IAM is global in scope

  • No need to recreate IAM User in each Region.
  • However, the accessed resource may be located in a specific Region and the policy may limit that scope.

4. Practical example

An engineer can only view production resources; the application uses a separate role to read data.

The audit team uses read-only roles; The development team has limited permissions according to the environment. Use groups to manage common rights for existing IAM Users; Use Identity Center to manage employee access across multiple accounts.

5. Comparison

Root controls the account; an IAM User is a long-lived identity; IAM Groups collect permissions for users, not roles.

IAM policies, Roles & permission model

1. Concept

A policy defines permissions; a role is an identity used to perform work with its assigned permissions.

2. Purpose

Grant the right permissions, on the right resources, without having to share passwords or access keys.

3. How it works

Read a policy

  • Policy: JSON rule set.
  • Each Statement answers: allow or prohibit, what to do, on what resources and under what conditions.
FieldMeaning
EffectAllow or Deny
ActionAPI/action, e.g. s3:GetObject
ResourceResource ARN; object ARN is different from bucket ARN
ConditionConditions like MFA, IP or tag
PrincipalWho is authorized; appears in resource/trust policy, not in identity policy
  • The commonly used version is 2012-10-17; This is the policy language version.
  • For example, the identity policy only allows reading objects in a prefix:
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:GetObject","Resource":"arn:aws:s3:::example-bucket/reports/*"}]}

Identity policy and resource policy

  • Identity policy attached to user/group/role: what does this identity do?
  • A resource policy is attached to a bucket, queue or key and specifies who may access that resource.
  • With direct cross-account access, Allow is often needed on both the identity and resource side.
  • KMS also has its own key policy; Having S3 permissions may not be able to decrypt the object SSE-KMS.

How to consider rights

  • If there is no appropriate Allow, it will be denied by default.
  • Explicit Deny wins over Allow.
  • Rights are also limited by SCP, permissions boundary or session policy where those mechanisms apply; they are not self-authorizing.
  • Least privilege means only granting actions and resources that are truly needed, instead of using * for everything.

Role and STS

  • IAM Role: An identity used to perform a task without storing long-lived access keys in the application.
  • Trust Policy: Defines who can assume the role.
  • Permission Policy: Defines what the role can do and to which resources.
  • AWS STS: Issues temporary credentials: an access key, secret key, and session token.
  • IAM Roles Anywhere: Lets servers or applications outside AWS obtain temporary role credentials, such as an office server uploading backups to S3. It requires a certificate from a trusted CA and a suitable trust policy.
EC2/Lambda/user → assume role → temporary credential → call AWS API
IAM Roles Anywhere
  • IAM Roles Anywhere for the server, container or application to run outside of AWS Use IAM roles to receive temporary credentials, instead of keeping long-term access keys.
Other on-premises / cloud applications + X.509 certificate
↓ authenticate with the registered CA as trust anchor
IAM Roles Anywhere + IAM roles / profiles
↓
Temporary credentials
↓
AWS API according to role permissions
  • Requires a valid certificate from a trusted CA and an appropriate role trust policy.
  • For example, on-premises server uploads backup to S3.

IAM Roles for AWS services

IAM RoleWhat to use?
EC2 Instance RoleApplications on EC2 call S3, DynamoDB, SQS...; attach the role to EC2 via instance profile
ECS Task RoleApplications in ECS containers call AWS APIs
ECS Task Execution RoleECS agent/Fargate pulls image from ECR, sends container logs to CloudWatch Logs
Lambda Execution RoleLambda function calls AWS APIs and records logs according to the policy granted
EKS Pod Identity RoleGrant AWS permissions to Pods via association with the Kubernetes Service Account and Pod Identity Agent
IRSA Role (EKS)Pods assume roles via Kubernetes Service Account, IAM OIDC provider and STS
Step Functions Execution RoleWorkflow calls Lambda, ECS, DynamoDB... according to granted permissions
CloudFormation Service RoleCloudFormation creates, edits, and deletes stack AWS resources
Cross-Account IAM RolePrincipal in another account assumes role to access resources according to trust/permission policies
Service-Linked RoleAn AWS service manages the necessary resources for you
EC2 Application
└── EC2 Instance Role → S3

ECS Containers
├── Task Role → App calls S3
└── Task Execution Role → ECS pull ECR / send logs

Lambda Function
└── Lambda Execution Role → DynamoDB

EKS Pod
└── Pod Identity / IRSA Role → S3

Step Functions
└── Execution Role → Lambda

CloudFormation
└── Service Role → Create EC2 / RDS
  • ECS Task Role grants permissions to applications; Task Execution Role grants permissions to ECS agent/Fargate. Pod Identity and IRSA are two ways to grant AWS permissions to Pods; Details and conditions are in the EKS section. ·

Service-Linked Role

  • Service-Linked Role: A role dedicated to an AWS service so it can manage resources for you. AWS defines its permissions and trust.
  • Example: Auto Scaling uses it to create or terminate EC2 instances and register them with a load balancer.
  • Compared with an Instance Role: An instance role authorizes application code inside EC2, not Auto Scaling operations.
  • Creation: Many services create it when needed; the configuring identity needs iam:CreateServiceLinkedRole. Do not edit service-managed permissions.
AWS serviceSLR is used for
EC2 Auto ScalingManage EC2 lifecycle and register instances with load balancer
Elastic Load BalancingManage AWS resources needed by the load balancer, such as network interfaces
Application Auto ScalingScale the resources of supported services, for example ECS service or DynamoDB

4. Practical example

An image-processing EC2 instance can only read original images and write thumbnails in S3.

EC2 reads an S3 prefix using the instance role; Lambda logs using execution role. Deploy to another account using AssumeRole, with appropriate trust policy and assume rights on both sides.

5. Comparison

A trust policy determines who can assume a role; a permissions policy determines what the role can do.

Inline Policy vs Managed Policy & Identity Aggregation

CriteriaInline PolicyManaged Policy
Nature & ClassificationPolicy is tied directly to a single identityPolicy exists independently: including AWS Managed (eg AdministratorAccess Omnipotence is different from SystemAdministrator limited administrative rights) and Customer Managed (you create and manage versions yourself)
Mounting rangeA single User / Group / RoleReusable for many Users / Groups / Roles
Lifecycle when deleting an identityDelete by ownership identityMaintain independence within IAM
When to use?1–1 rights are uniquely tied to an identityRight to standardize, reuse, and version control
ComponentNatureCredential used
IAM UserLong-term identity in accountPassword (Console) or Access Key ID + long-term Secret Access Key
IAM RoleThe temporary identity is assumedSTS Temporary Credentials (Access Key + Secret Key + Session Token)
IAM PolicyJSON document specifies Allow / DenyTrust Policy (who can assume) · Permission Policy (what can be done)
IAM credentials, authentication & security tools

1. Concept

The console uses a web interface, the CLI uses commands, and SDKs use code to access AWS; each needs identity authentication.

2. Purpose

Log in and call AWS securely, and find credentials or permissions that are no longer needed.

3. How it works

Two main ways of access:

Console → password + MFA
CLI / SDK → credentials → AWS API

Console, CLI and SDK

  • Console = browser interface; CLI runs command; SDK calls AWS from code.
  • CLI/SDK uses temporary credential from SSO/role or long-term access key, IAM User access key is not required.
  • Temporary credentials include access key ID, secret access key and session token.
  • Do not hard-code credentials into the application; Do not commit the credentials file.

MFA and password policy

  • MFA requires additional authentication factors in addition to passwords.
  • Prioritize MFA for root and high privileges.
  • IAM's password policy controls IAM User password length, complexity, expiration, and reuse; Does not replace MFA and does not apply to all federation systems.

Profile and CloudShell

  • CLI profile separates configuration between accounts/roles. aws configure sso set up SSO;
  • aws configure can store access keys in ~/.aws/credentials and Region configuration in ~/.aws/config.
  • CloudShell: terminal in Console, has CLI available and uses current login session permissions.
  • It does not grant itself administrative rights.

Permission checking tool

ToolsUsed to
Credentials ReportView IAM User password, access key and MFA status for the entire account
Access AdvisorView service usage information to consider narrowing permissions
IAM Access AnalyzerIAM Access Analyzer is a service that helps analyze AWS access permissions, detecting permissions that are too broad, permissions that are not in use, or resources that may be accessed unintentionally.
  • Usage data is the basis for review, not the reason for immediate removal: some tasks only run monthly or when DR.

4. Practical example

An employee uses SSO for the CLI instead of storing long-lived access keys on a laptop.

Employees use SSO profiles for CLI; workload uses role. Check access keys that have not been used for a long time, delete excess keys and reduce permissions after checking actual needs.

5. Comparison

MFA strengthens sign-in; Credentials Report checks credentials; Access Analyzer analyzes access permissions.

IAM - Advanced

AWS Organizations & Service Control Policies (SCP)

1. Concept

Organizations groups AWS accounts for centralized permission, billing, and policy management.

2. Purpose

Separate workloads across accounts while centrally managing billing, organization structure, and permission limits.

3. How it works

  • AWS Organizations is used to manage multiple AWS accounts within the same organization, helping to separate workload, billing, and administration rights.
  • AWS Organizations = Multi-Account Management + Consolidated Billing + OU + SCP

Management Account & Member Account

  • Management Account = Organization management account
  • Member Account = member accounts

For example:

Management Account
├── Dev Account
├── Test Account
├── Prod Account
└── Finance Account
  • One member account belongs only one Organization at a time.

Why use multiple accounts?

Instead:

1 AWS Account
├── Dev
├── Test
├── Prod
└── Finance
  • split into: Dev Account · Test Account · Prod Account · Finance Account
  • Help: Separation of rights · Separation of billing · Separation of workload · Reduce blast radius
Dev encountered a security issue
↓
reduce the risk of direct effects Prod

Consolidated Billing

Organizations can pool costs across multiple accounts:

Dev
Test
Prod
Finance
↓
Consolidated Billing
↓
1 bill chung
  • Benefits: 1 payment method · Central cost tracking · Volume discount · Savings Plans / RI sharing

Organizational Unit - OU

  • OU = group of AWS accounts with the same policy/governance.
Organization Root
├── Development OU
│   ├── Dev Account A
│   └── Dev Account B
│
└── Production OU
    ├── HR Account
    └── Finance Account

OUs can be nested:

Root
↓
Production OU
↓
Finance OU
↓
Finance Account

OU = account group to manage policy, not network/VPC.

Service Control Policy - SCP

  • SCP: Sets a maximum permission boundary for accounts within its scope.
  • Does not grant permissions: IAM must still allow an action; SCPs limit the permissions available.
  • Example: If IAM permits S3 reads but an applicable SCP denies S3, the request is denied.
  • Explicit Deny: An explicit SCP deny takes priority over an allow.

Explicit Deny in SCP wins over IAM Allow.

Where can SCP be mounted?

  • Root · OU · Account
Root
↓
Sandbox OU
↓
SCP: Deny s3:*
↓
Account A
Account B
  • → both Account A and B are blocked from S3.

SCP Evaluation

When user/role calls API:

Request
↓
Does SCP have Deny?
↓
Does SCP give action?
↓
Does IAM / Resource Policy Allow?
↓
Allow / Deny

To request successfully:

SCP
→ must allow

IAM
→ must also allow

Blocklist Strategy

  • FullAWSAccess + Deny unwanted services
Allow Everything
↓
Deny DynamoDB
  • EC2 ✅ · S3 ✅ · Lambda ✅ · DynamoDB ❌

Blocklist = for many, block some.

Allowlist Strategy

  • Only Allow the services you need to use
  • Allow EC2 · Allow CloudWatch
  • EC2 ✅ · CloudWatch ✅ · S3 ❌ · Lambda ❌ · DynamoDB ❌

Allowlist = only for what is listed.

SCP Inheritance

SCP applies along the following lines:

Root
↓
OU cha
↓
OU con
↓
Account
Root
Allow EC2 + S3
↓
Production OU
Allow EC2
↓
Account A
  • EC2 ✅ · S3 ❌
  • Because the parent OU did not give S3.

Account below cannot reopen permissions that have been limited by the parent OU.

Tag Policy

  • Tag Policy is used to standardize tags in Organization.
  • Environment = Dev / Test / Prod; or: CostCenter = 100 / 200
  • Used for: Billing · Cost Allocation · Audit · Resource Classification · ABAC

Centralized Logging

There is usually a separate account for logging/security:

Dev
Prod
Finance
↓
CloudTrail / CloudWatch Logs
↓
Central Logging Account

Security teams can:

Assume Cross-Account Role
↓
Investigate other accounts

4. Practical example

A company separates development and production accounts and uses an SCP to prevent disabling audit logging.

Development OU
↓
policy is more open
Production OU
↓
SCP is tighter
Sandbox OU
↓
Deny service is sensitive / expensive
Multiple Accounts
↓
Consolidated Billing
↓
Central Finance

5. Comparison

An SCP limits maximum permissions; IAM policies grant permission to perform actions.

Tag Policy vs IAM

Tag Policy = tag must be correct

IAM = user/role has permission to call the API or not

Tag Policy
→ Environment can only be Dev/Test/Prod

IAM can use tags to control:

User Project=A
↓
Manage Resource Project=A

ABAC = Attribute-Based Access Control

IAM policy evaluation, boundaries & cross-account access

1. Concept

AWS evaluates the relevant policies to decide whether a resource access request is allowed.

2. Purpose

Understand how AWS combines multiple policy layers to decide whether a final request is Allow or Deny.

3. How it works

  • Default = Implicit Deny
  • Explicit Deny = wins all Allow

For example:

Deny sqs:*
+
Allow sqs:DeleteQueue
↓
DeleteQueue ❌

Just have Explicit Deny matches → request is blocked.

Main types of Policy

  • Identity-based Policy = attached to User / Group / Role = what does principal do?
  • Resource-based Policy = attached to resource = who can access the resource
  • Resource policy example: S3 Bucket Policy · SQS Queue Policy · SNS Topic Policy · Lambda Resource Policy

SCP, Boundary, Session Policy

  • SCP: Limits permissions at organization, OU, or account scope.
  • Permissions Boundary: Limits the maximum permissions of an IAM user or role.
  • Session Policy: Narrows permissions for a temporary session.
  • Shared rule: None grants permission by itself. The identity still needs an appropriate allow.

Effective Permission

Can simply remember:

Identity Allow
∩
Permission Boundary
∩
SCP
∩
Session Policy (if any)
↓
Effective Permission

and:

Explicit Deny
→ DENY now
Identity Policy:
Allow iam:CreateUser

Boundaries:
Allow s3:*
Allow ec2:*

↓
There is no delivery
↓
CreateUser ❌

Boundary Allow a service does not mean providing that service yourself.

IAM Conditions

  • Condition adds context to the decision.
  • Can check: MFA · IP Address · VPC Endpoint · Principal Tag · Resource Tag · Organization ID

ABAC

  • ABAC = Attribute-Based Access Control
  • User: · Department = Data · EC2: · Project = DataAnalytics

Policy can give:

Data Team
↓
Start/Stop only
↓
EC2 has Project=DataAnalytics
  • → tag-based management instead of creating separate policies for each user.

MFA Condition

MFA = false
↓
Deny ec2:TerminateInstances
  • Even if the user has: Allow ec2:*
  • then: Terminate EC2 ❌; because Explicit Deny wins.

aws

  • Bucket Policy can only be accessed by accounts belonging to the same AWS Organization.
S3 Bucket
↓
Condition:
aws:PrincipalOrgID = o-123456
Account in Organization
→ ✅

Account outside the Organization
→ ❌
  • → no need to list each AWS account in the policy.

Cross-Account Access

  • There are 2 popular ways.
1. AssumeRole
Principal Account A
↓
AssumeRole
↓
Role Account B
↓
Temporary Credentials
  • Principal operates under the authority of role session.
  • Suitable when needed: many resources · many AWS services · a separate set of permissions at Account B
2. Resource-Based Policy
Principal Account A
↓
Resource Policy in Account B
↓
Resource
User Account A
↓
PutObject
↓
S3 Bucket Account B
  • User still retains original identity/authority in Account A.
  • Suitable for just sharing: S3 Bucket · SQS Queue · SNS Topic · ...

AssumeRole = change to role session. Resource Policy = current principal accesses resources directly.

EventBridge also needs Permission

  • Rule match event is not enough.
EventBridge Rule
↓
Target
  • EventBridge must have permission to call target.

Example with Lambda:

EventBridge
↓
Lambda Resource Policy
↓
Allow InvokeFunction

For some targets such as ECS Task, EventBridge is often used:

IAM Role
↓
EventBridge assume role
↓
Run target

Rule match with event ≠ automatically has the right to invoke target.

Common IAM Global Condition Keys

Condition KeyMeaning of distinction
aws:PrincipalOrgIDCheck that the principal calling the request belongs to the correct AWS Organization ID (for example, limit the S3 bucket to the internal Organization without needing to list each Account ID)
aws:PrincipalOrgPathsThe principal limit must be within the Organizations specific OU path
aws:PrincipalTag/<Key>Compare tags attached to IAM User/Role or ABAC serving session
aws:SourceIpLimit the request's source IP/CIDR range (not applicable when calling through some intermediate AWS services that do not keep the original IP)
  • "Condition": { "StringEquals": { "aws:PrincipalOrgID": "o-abc123xyz" } }

4. Practical example

A developer can create Lambda functions, but a permissions boundary prevents granting administrator permissions to execution roles.

Boundary is very useful when allowing developers to create their own IAM roles/users.

Developer
↓
Create Role
↓
Permission Boundary is required

The boundary example shows: S3 · EC2 · CloudWatch

Developer even attach: AdministratorAccess

Still can't go beyond the boundary.

Boundary = prevent privilege escalation when delegating IAM administration.

5. Comparison

Identity policies grant permissions; boundaries and SCPs set limits; cross-account access also depends on the resource side.

S3 Bucket ARN vs Object ARN

Very common mistake:

s3:ListBucket
→ arn:aws:s3:::my-bucket
s3:GetObject
s3:PutObject
s3:DeleteObject
→ arn:aws:s3:::my-bucket/*

Remember: Bucket = bucket ARN

Object = bucket ARN + /*

AWS IAM Identity Center

1. Concept

IAM Identity Center lets employees sign in once to access their assigned AWS accounts and applications.

2. Purpose

Avoid separate employee sign-ins and access administration for each AWS account and application.

3. How it works

  • AWS IAM Identity Center is used for single sign-on and centralized access management for multiple AWS accounts and business applications.
1 User
↓
1 Login / SSO
↓
Multiple AWS Accounts / Applications

Identity Center = central login + central access management.

Instead of creating IAM User in each Account

Shouldn't:

User Bob
├── IAM User in Dev
├── IAM User in Test
└── IAM User in Prod

With Identity Center:

Bob
↓
IAM Identity Center
↓
Dev / Test / Prod
  • → Easier onboarding/offboarding management and avoiding permanent IAM User/access keys in each account.

Identity Source

  • Identity Center needs to know: Who is the user? · Which group?
  • Identity source can be: Identity Center built-in store · Active Directory · Okta · OneLogin · Other external IdP

For example:

Employee
↓
Okta
↓
IAM Identity Center
↓
AWS Accounts

Permission Set

  • Permission Set: A prepared permission bundle, such as read-only, application development, or database administration.
  • Contents: Can include AWS managed, customer managed, or inline policies.
  • Assignment: Choose a user or group, an account, and a permission set. Identity Center provides the corresponding access through a role in that account.
  • Example: Developers can modify the Dev account but have read-only access to Production.

Assignment

  • Assignment answers 3 questions: WHO? = User / Group
  • WHERE? = Which AWS Account?
  • WHAT? = Which Permission Set?
Developers Group
↓
Dev Account
↓
FullAccess
Developers Group
↓
Prod Account
↓
ReadOnlyAccess
  • Same group but permissions may be different for each account.

Login Flow

User logs into the portal:

User
↓
Identity Center / IdP
↓
SSO Portal
↓
Select AWS Account
↓
Select Permission Set
↓
Temporary Role Session
↓
AWS Console / CLI

Users do not need a separate password/IAM User in each AWS account.

Group in Identity Center ≠ IAM Group

  • Identity Center Group = user group to assign access to multiple accounts/apps
  • IAM Group = IAM Users group in an AWS account
  • Two different concepts.

SSO for Applications

  • Identity Center isn't just for AWS.
  • Can SSO to: Salesforce · Box · Microsoft 365 · SAML 2.0 Applications
Employee
↓
Identity Center
↓
AWS Account
or
Business Application
  • → same identity source for multiple systems.

ABAC

  • Identity Center support Attribute-Based Access Control.
  • For example, the user has: Department = Data · CostCenter = 100
  • Resource has tag: Department = Data

Policy may stipulate:

Principal Department
=
Resource Department
↓
Allow
  • → permissions can be changed based on attributes instead of creating many separate policies.

Matrix Group × AWS Account × Permission Set

In IAM Identity Center, Group Determines which pairs the user sees and selects AWS Account + Permission Set Which right after SSO login:

GroupAWS AccountPermission Set received
DeveloperDEV AccountDeveloperAccess
DeveloperPROD AccountReadOnlyAccess (does not automatically have Admin rights)
AdministratorDEV / PROD AccountAdministratorAccess

4. Practical example

The finance team signs in to a portal and only sees its assigned finance account and permissions.

Developer:

Login once
↓
Dev Account → FullAccess
Prod Account → ReadOnly

DBA:

costCenter = DB
↓
Permission Set
↓
Only manage resources with appropriate tags

Employee quits:

Disable/Delete identity in central source
↓
lost access to many AWS accounts/apps

→ do not have to delete each IAM User in each account.

Okta / AD
↓
Identity Center
↓
AWS Organizations Accounts
Developers
↓
Dev = FullAccess
Prod = ReadOnly
Identity Center
↓
Salesforce / Microsoft 365 / SAML Apps

5. Comparison

Identity Center serves workforce SSO; Cognito primarily manages users of web and mobile applications.

AWS Directory Service & Active Directory integration

1. Concept

Directory Service lets applications use Active Directory identities by providing AD on AWS or connecting an existing directory.

2. Purpose

Let AWS applications use enterprise AD identities and required directory capabilities.

3. How it works

  • AWS Directory Service helps applications on AWS use Active Directory (AD): either create a directory on AWS, or connect to an existing company AD.

AD is where employee accounts, computers, and groups are managed. When Bob logs in, AD helps check Who is Bob?. Bob in AD different from IAM User in your AWS account.

Contact IAM Identity Center

If using AD as an identity source:

AD → determines who Bob is
IAM Identity Center → assign Bob permission to Dev / Test / Prod
  • Bob having an account in AD does not mean he can access an AWS account. Administrators must still assign permissions to Bob or Bob's group in IAM Identity Center.

Active Directory Forest Trust

Afternoon TrustAi tin ai?Access consequences
Outgoing TrustAWS Managed Microsoft AD tin domain On-premisesOn-premises users can access domain resources on AWS
Incoming TrustDomain On-premises tin AWS Managed Microsoft ADUsers belonging to AWS AD can access resources in the On-premises domain

4. Practical example

A Windows application on AWS needs domain joining and sign-in with company AD accounts.

  • Migrate Windows/managed directory workloads to AWS but still establish two-way trust with corporate AD.
  • Use AD Connector when you want AWS to authenticate employees with on-prem AD without creating a directory copy in AWS.
  • Use Simple AD for standalone AWS applications that need directory AD-compatible but do not need on-premises federation.

5. Comparison

  • Managed Microsoft AD runs AD on AWS;
  • AD Connector forwards authentication to existing AD;
  • Simple AD offers fewer features.

Three options need to be distinguished

1. AWS Managed Microsoft AD

AWS creates and manages the infrastructure for one Microsoft AD runs on AWS. You can create users and groups in this AD for applications to use.

Bob is created in Microsoft AD on AWS
↓
Bob logs into the application
↓
AD on AWS authenticates Bob

Use when: Windows applications or machines on AWS need Microsoft AD.

  • If the company already has an AD in the office, it can be set up trust between two ADs.
  • Then a user like Bob can still reside in corporate AD and use that identity to access appropriate resources on AWS.
2. AD Connector

AD Connector is bridge From AWS to AD the company has it. It does not create a new AD to save the Bob account.

Bob is in the company AD
↓
Bob logs into the AWS service
↓
AD Connector forwards the request to corporate AD
↓
AD company authenticates Bob

Use when: The company already has AD and wants AWS services to use those users. Creating a user or changing Bob's password is still done in the company AD.

3. Simple AD

Simple AD is one basic, independent directory on AWS. You create and manage users in Simple AD.

Bob is created in Simple AD
↓
The application on AWS uses the Bob account

Use when: The workload needs basic directory functionality, but does not need full Microsoft AD or connection to corporate AD.

Simple AD Does not support trust with other AD and Do not use as an identity source for IAM Identity Center.

Quick comparison

ServiceWhere is Bob's account located?Main idea
AWS Managed Microsoft ADCan be in AD on AWS; You can also use users from trusted ADThere is Microsoft AD on AWS
AD ConnectorCompany AD already existsConnect AWS to existing AD
Simple ADSimple AD on AWSBasic, independent directory
AWS Control Tower

1. Concept

Control Tower sets up a multi-account AWS environment with shared configuration and governance controls.

2. Purpose

Provision accounts against a consistent baseline and monitor multi-account compliance.

3. How it works

  • AWS Control Tower helps set up and manage multiple AWS accounts under a common baseline. It uses AWS Organizations as its foundation, creating landing zones, allocating accounts, and tracking compliance with rules.

Remember: Control Tower is Construction and management tools; landing zone is created environment. Then, when the team needs a new account, the administrator can provision the account into this environment Account Factory.

AWS Organizations
↓
Control Tower builds landing zone
↓
Dev / Test / Prod accounts
↓
Apply controls + monitor compliance
  • Instead of each team creating its own account with its own configuration, administrators use Account Factory to level accounts in the Organization structure and apply baseline governance.

Guardrail: prevention is different from detective

  • Preventive control block violations before action is taken. Usage example SCP to restrict operations in unauthorized AWS Regions.
User calls API in restricted Region
↓
Preventive control check
↓
Deny
  • Detective control check configuration after the resource is created or changed, often passed AWS Config rule. For example: detecting a resource missing tags.
Resource is created but tag is missing
↓
AWS Config review
↓
NON_COMPLIANT
TypeThe mechanism in the exampleResults
PreventiveSCPBlock violations.
DetectiveAWS Config ruleDetect and report non-compliant resources.

Need to prevent creating wrong resources → preventive. Need to find the wrong resource → detective. Detecting a violation does not mean the action has been blocked or the resource has been fixed.

Notification and remediation flow

Suppose the team wants to find a resource that is missing a tag:

Resource in member account
↓
AWS Config rule evaluates the tag
↓
NON_COMPLIANT
↓
SNS notifies admin
↓
Lambda adds tags according to defined rules
↓
AWS Config reevaluated
  • SNS and Lambda are workflows that require additional configuration. Lambda needs permission to edit the resource and must know Which tag is correct?; Don't guess yourself CostCenter for resource production.
  • Preventive control operates in an earlier step: it Refuse unauthorized action, for example calling an API in a restricted Region, instead of waiting for AWS Config to detect it later.

Three types of Control (Preventive / Proactive / Detective), Account Factory & Drift

Control typeTime of inspectionEnforcement mechanism
PreventiveImmediately upon calling the AWS API actionSCP/RCP blocks the offending operation
Proactive controlsBefore CloudFormation creates or updates resourcesCloudFormation Hooks check template/resource properties
DetectiveAfter the resource has been created or changedAWS Config Rules detect non-compliance status
Components & Drift in Control TowerFunction / Expression of deviation from the standard state
Account FactoryComponent that automatically allocates new AWS Accounts according to standard baselines (OU, network, logging CloudTrail/Config)
Account / OU DriftThe account is illegally transferred to an OU, deleted from the Organization or the Foundational OU is deleted
SCP / Control DriftThe SCP managed by the Control Tower is modified/removed or the control stops working as designed
Landing Zone / Inheritance DriftIAM Role required/trusted access is disabled or the account no longer inherits the correct baseline from the OU

4. Practical example

When a new team joins, Account Factory creates an account with the company's logging and security baseline.

Administration situationHow to deal with Control Tower
Build a standard Landing ZoneCreate a multi-account environment with Organization structure, baseline governance and compliance dashboard
Limit AWS RegionsTurn on Preventive Control (SCP) to immediately block API calls in unauthorized Regions
Check & add TagUse AWS Config (Detective) to detect resources missing tags → report to SNS → run Lambda to tag according to clear rules

5. Comparison

Organizations manages the account hierarchy; Control Tower automates the landing zone, account provisioning, and controls.

LDAP, SAML 2.0, SCIM & Custom Identity Broker

1. Concept

LDAP queries identity directories, SAML supports federated sign-in, SCIM synchronizes users, and a custom broker connects a login system to AWS access.

2. Purpose

Differentiate the roles of each enterprise identity protocol and the two federation login flows to AWS.

3. How it works

Two federated authentication flows need to be distinguished

Flow A — Without SAML (using Custom Identity Broker):
Employee → Custom Identity Broker → check LDAP → call AWS STS to get temporary credentials → call AWS Federation Endpoint → open AWS Console

Stream B — With SAML 2.0 Federation (preferred, no need to write Broker yourself):
Employee → IdP (authenticate with LDAP) → return SAML Assertion → send to AWS SAML Endpoint / STS (AssumeRoleWithSAML) → open AWS Console

4. Practical example

A company uses SAML for employee sign-in to AWS and SCIM to provision users and groups from its IdP.

5. Comparison

LDAP queries directories; SAML carries authentication assertions; SCIM manages user/group lifecycles; STS issues temporary credentials.

Distinguishing table for LDAP, IdP, SAML 2.0, SCIM and STS

Composition/ProtocolCore functions
LDAPDirectory lookup protocol and username/password check directly against directory (e.g. Active Directory)
Identity Provider (IdP)System that authenticates users and issues federated login credentials (AD FS, Okta, Entra ID, Keycloak)
SAML 2.0Standard for transmitting authentication messages (SAML Assertion) from IdP to AWS for SSO login without revealing the password to AWS
SCIMProtocol Automatically synchronize Users and Groups lifecycle (create, edit, delete) from IdP to IAM Identity Center
Custom Identity BrokerThe middleware application builds itself when the internal system only has LDAP and There is no IdP that supports SAML/OIDC
AWS STS & Federation EndpointSTS grants temporary credentials; Federation Endpoint changes temporary credentials to sign-in URL into AWS Console

EC2

Amazon EC2 fundamentals & launch configuration

1. Concept

EC2 is a virtual server on AWS; choose its configuration and install the operating system and applications you need.

2. Purpose

Run virtual servers when you need to control the operating system, software and how applications work.

3. How it works

What is EC2?

  • EC2 rents compute on demand.
  • AWS manages the physical infrastructure; You manage the OS, patches, software and application data on your device.
  • An instance resides in an AZ.
  • If you want to tolerate AZ errors, you need many instances across many AZs; A large machine does not automatically create High Availability.

Options when creating a machine

ComponentDecide what
AMIOriginal operating system and software
Instance typeCPU, RAM, network and I/O capabilities
VPC/subnetWhere is the device located and what network connection is there?
Security GroupTraffic is allowed in/out
IAM roleApplication permissions to call AWS services
StorageEBS for persistent disks; EFS for shared files; Instance Store for temporary data
Key pairUsed when logging in SSH; Can be administered using Systems Manager if configured properly

User Data

  • User Data is usually a script that installs a package, loads configuration, or starts an application.
  • On Linux, by default the script runs as root on first boot; can structure image reruns.
  • Do not put secrets directly in User Data.
  • When needed, the application retrieves secrets from the Secrets Manager/Parameter Store using a role with limited permissions.

Compile into a scalable application

Users → ALB → EC2 in Auto Scaling Group in multiple AZs
                   └─ Persistent data in appropriate database/storage
  • Launch Template saves instance creation configuration so ASG can recreate machines consistently.
  • CloudWatch monitors load; ASG adjusts engine numbers.

CloudWatch monitoring

EC2 monitoring modeCollection Cycle & Range
Basic MonitoringDefault free: most EC2 metrics sent each 5 minutes (Status check metrics are still available every 1 minute)
Detailed MonitoringPay extra to receive EC2 host metrics every time 1 minute; no automatically collect RAM or disk inside the OS (AWS Docs)
CloudWatch AgentInstall inside the OS to push RAM, swap, disk space and application logs to CloudWatch

AWS Local Zones, EC2 Swap Space & Apache Tomcat

Components/ServicesNature & Architectural Notes
AWS Local ZonesExtension of one parent Region Place compute/storage near major urban centers to achieve latency single-digit milliseconds; Physical location separate from main AZ so need to check data residency requirements
EC2 Swap SpaceArea on disk used temporarily by OS when RAM is full (slower than RAM); Basic/Detailed Monitoring is not collected by itself but must be used CloudWatch Agent (swap_used, swap_free, swap_used_percent, mem_used_percent)
Apache TomcatJava Servlet/JSP web container running on EC2, Beanstalk or containers (persistent server/container model, distinct from AWS Lambda serverless functions)

4. Practical example

A legacy Java application runs on EC2 because it needs Tomcat and custom libraries.

Web/API needs its own package; Legacy applications need OS control; batch or HPC needs specific type of CPU/GPU. Use tags to manage and view costs by environment.

5. Comparison

EC2 provides server control; Lambda runs event-driven code; Fargate runs containers without managing hosts.

EC2 instance types, lifecycle & Hibernate

1. Concept

An instance type defines EC2 CPU and memory; stopping, starting, or terminating an instance affects which resources and data remain.

2. Purpose

Choose the machine configuration and shutdown method appropriate to resources, startup time and data to keep.

3. How it works

Select instance family

FamilySuitable
T/M – general purposeWeb, dev/test; T instances use CPU credits for burst workloads
C – compute optimizedHeavy processing of CPU, encoding, batch
R/X – memory optimizedIn-memory database, large dataset in RAM
I/D – storage optimizedLocal I/O or large data on disk
P/G – accelerated computingGPU, ML or graphics
  • The name m5.2xlarge includes family M, generation 5 and size 2xlarge.
  • No need to memorize the vCPU table of each machine; Select by CPU, RAM, I/O or network bottleneck.

Reboot, Stop and Terminate

OperationWhat happens?
RebootRestart the OS; holds instance and storage.
StopStop EBS-backed instance: keep EBS, lose RAM and Instance Store. Self-provisioned Public IPv4 usually changes when restarting.
TerminateDelete instance. EBS with DeleteOnTermination will be deleted; Volumes that do not enable this attribute remain and continue to charge.
  • Note: Stop does not free EBS.

Hibernate

  • Hibernate: Saves RAM to the encrypted EBS root volume and stops the instance.
  • Resuming: Reloads RAM and processes to restore the previous state, useful for slow-starting applications.
  • Requirements: Enable support at launch, use a supported instance and AMI, and provide enough root-volume space for RAM.
  • Limits: Do not hibernate longer than 60 days; Instance Store data is still lost. Check operating-system-specific limits.
RAM → EBS root encrypted → stop → start → reload RAM

4. Practical example

A development server takes time to load data into memory, so Hibernate restores its working state.

C-family for video encoding; R-family for data processing in RAM. Hibernate for dev environments or slow application startups; Use Multi-AZ and backup to protect availability/data.

5. Comparison

Stop loses RAM; Hibernate saves RAM to EBS; Terminate ends the instance and handles disks according to configuration.

EC2 networking, Security Groups & IAM

1. Concept

EC2 uses network interfaces for connectivity, security groups to filter traffic, and IAM roles to authorize application access to AWS services.

2. Purpose

Control your application's network connectivity and access to AWS on EC2.

3. How it works

Security Group

  • Security Group is a stateful firewall attached to ENI.
  • There is only Allow rule; The rules of multiple SGs are combined.
  • The new SG defaults to no inbound and no outbound; The response of the connection is self-passage.
Internet → ALB SG: HTTPS 443
ALB → App SG: indicates the source is ALB SG
App → DB SG: indicates the source is App SG on the database port
  • SG reference helps avoid having to update IP when ASG changes machines.
  • Timeout can be due to SG, NACL or route; connection refused is usually because there is no listening service on that port.

Public and private IP

  • Private IP used in VPC network.
  • EC2 direct Internet access needs public IP with route to Internet Gateway and appropriate network rules; Just being in the public subnet is not enough.
  • Private instances can go to the Internet via NAT or call AWS services via VPC Endpoint.
  • Commonly used SSH 22, HTTPS 443, RDP 3389; Should limit administrative sources or use Systems Manager.

ENI and Elastic IP

  • ENI: An EC2 virtual network card with private IPs, a MAC address, and security groups, scoped to one AZ.
  • Moving an ENI: Secondary ENIs can move between instances in the same AZ. The primary ENI cannot be detached from its instance.
  • Elastic IP: A fixed public IPv4 address that can be reassigned to another resource.
  • Cost and quota: Public IPv4 is billable. EIP quotas commonly start at five per Region and can be increased; consider ALB and DNS if fixed IPs are unnecessary.

Enhanced Networking and EFA

  • Elastic Fabric Adapter (EFA) is a network interface for EC2 running HPC or distributed ML, helping instances exchange data with low latency and high throughput.
MechanismFunction
Enhanced Networking / ENASR-IOV helps increase bandwidth/PPS and reduce latency for conventional IP networks. ENA is the modern choice; Intel 82599 VF is legacy.
EFAAdd OS-bypass via Libfabric for MPI/NCCL compatible applications; tightly coupled workloads require continuous data exchange.
  • Needs instance type, OS, driver/library and Security Group supported by EFA.
  • Used for multi-node HPC simulation or distributed ML training.

IAM role for EC2

  • Instance profile brings the IAM role into EC2.
  • SDK retrieves temporary credentials via metadata service; Enable IMDSv2 and grant dark permissions minimal.
  • Do not save personal access keys on the device.
  • Network permission and IAM permission are two separate layers: opening a port does not grant read access to S3; Role level does not create network routes.

4. Practical example

A web server only accepts requests from its ALB while reading a private bucket through an IAM role and S3 endpoint.

EC2 private reads S3 by role and S3 VPC Endpoint. ALB receives HTTPS from users, EC2 only receives requests from ALB SG, database only receives requests from app SG.

5. Comparison

Security groups control network connections; IAM controls API permissions; permission alone does not provide connectivity.

Detailed distinction between ENA vs EFA (Networking & HPC)

CriteriaENA (Elastic Network Adapter)EFA (Elastic Fabric Adapter)
Main purposeEnhanced Networking standard for EC2 (high bandwidth, large PPS)HPC & Distributed AI/ML multi-node tightly coupled
Transmission mechanismGoes through the operating system's TCP/IP stackSupport OS-bypass qua Libfabric and communication MPI to minimize latency
EC2 purchasing & placement strategies

1. Concept

Choose EC2 purchasing and placement options to balance cost, performance, and failure resilience.

2. Purpose

Reduce costs and choose the right machine placement for latency, fault tolerance or licensing requirements.

3. How it works

Choose to buy by workload:

  • On-Demand = flexible
  • Savings Plans / Reserved Instances = commitment to discounts
  • Spot = low prices, subject to disruption
  • Capacity Reservation = capacity reservation

Choose how to pay

ChooseWhen used
On-DemandUnpredictable loading, short-term, unwilling to commit
Reserved InstancesStable loading, 1 or 3 year commitment; Standard/Convertible have different levels of flexibility
Savings PlansCommit to spending per hour for 1 or 3 years
SpotLoad is tolerant of interruptions, has retry/checkpoint
Capacity ReservationNeed to keep capacity at one AZ, no discount
Dedicated InstanceNeed hardware isolated from other accounts
Dedicated HostNeed to control physical host or license by socket/core
  • Compute Savings Plans are flexible across family/Region and Fargate/Lambda;
  • EC2 Instance Savings Plans are tied to family and Region, flexible in size/OS/tenancy.
Regional RI and Zonal RI
Scope of RIDiscountKeep capacity
Regional RIApplicable in Region; Has size flexibility for Linux/UNIX, default tenancy when appropriateNo
Zonal RIApplies to matching EC2 configurations in the selected AZ; no AZ/instance-size flexibilityYes, for specific configurations within an AZ
  • Standard/Convertible is the offering class; Regional/Zonal is scope, two different classifications.

Spot needs an interruption-tolerant design

  • Spot uses available capacity and can be reclaimed by AWS.
  • Interruption announcements are usually made about 2 minutes in advance; do not consider it a guaranteed time for any interruption.
  • Use multiple instance types/AZ, checkpoints and external persistent data storage instance. instance.
  • Consistent batch, CI and worker reruns; poor job fit impossible interruption.

Keeping capacity is different from discounting

  • Capacity Reservation: Reserves room to run EC2 in one AZ; you pay for reserved capacity even when unused.
  • Regional RI / Savings Plans: Provide discounts under the commitment terms but do not reserve room to run instances.
  • Zonal RI: Combines an RI discount with capacity reservation for the matching configuration in the selected AZ.
  • Combination: A Capacity Reservation can use an eligible RI/Savings Plans discount to provide both capacity and lower cost.

Placement Groups

StrategyHow to set up the machineTrade-off
ClusterClose together in an AZLow Latency, high throughput; does not accept AZ's fault
SpreadSeparate hardware for each machine, possibly multiple AZsIsolate small groups of important machines; Up to 7 running instances/AZ with rack-level spread
PartitionSplit a rack group into partitionsKafka/HDFS/Cassandra fusion; Maximum 7 partitions/AZ

4. Practical example

Checkpointed video-rendering jobs use Spot; a steady production website uses an appropriate pricing commitment.

HPC needs very fast exchange nodes: Cluster. Important nodes that need to be isolated for hardware errors: Spread. Large distributed system self-replicates data: Partition. Batch can be run again: Spot combined with checkpoint.

5. Comparison

Savings Plans and RIs primarily discount usage; Capacity Reservations reserve capacity; placement groups control placement.

Distinguish between Regional RI vs Zonal RI & Offering Class

RI Properties (1 or 3 years)Core distinction
Regional RI vs Zonal RIRegional RI flexible AZ and instance size in the same family but does not hold capacity; Zonal RI attaches a specific AZ and There is a capacity reservation
Standard RI vs Convertible RIStandard offers deeper discounts but limits exchange of instance families; Convertible reduces less but changes to another instance family/OS/tenancy of equal or higher value
EC2 Storage Options

1. Concept

EC2 can use dedicated EBS disks, shared filesystems such as EFS, or temporary local Instance Store storage.

2. Purpose

Select persistent disk, temporary disk or shared file for EC2.

3. How it works

EBS volume types

TypeSuitable
gp3 / gp2 — SSDGeneral purpose. gp3: baseline 3,000 IOPS, 125 MiB/s; IOPS/throughput are capacity independent. gp2: IOPS increases with size, has burst credits.
io1 / io2 Block Express — SSDDatabase needs high IOPS, stability and low latency.
st1 — HDDBig data, warehouse, log; throughput for regular sequential I/O.
sc1 — HDDLow-access data, low cost priority.
  • Boot volume used SSD. EBS charges for provisioned capacity, even when EC2 is stopped.
EBS featureConditions & Notes
Multi-AttachSupport only io1/io2, maximum 16 EC2 Nitro in same AZ; Required to use application and cluster-aware file system (not using regular EXT4/XFS for multiple machines to record at the same time)
EncryptionKMS protects volumes, EC2–EBS traffic and snapshots; Do not enable it directly on the old unencrypted volume, but must create a new volume from the snapshot

Snapshots and AMIs

Snapshot = backup EBS at a time, save the changed block next time
Convert AZ = snapshot → create volume at destination AZ → attach EC2
AMI = OS/software/configuration model to launch EC2; belongs to Region, can be copied
  • Snapshots do not need detach, but need flush/pause writes for consistency.
  • Archive: restore 24–72 hours; Recycle Bin: keeps snapshots deleted by mistake for 1 day–1 year; FSR: avoids slowness when reading the block for the first time, has separate fees.

EFS

  • EC2 Linux → mount target in AZ → shared EFS. The SG of the mount target is open TCP 2049 from SG EC2; Encrypt at rest with KMS, in transit with TLS.
  • Regional = multiple AZs; One Zone = one AZ, lower cost
  • General Purpose = low latency
  • Elastic = self-adjusting throughput; Provisioned = reserved
  • Bursting = throughput according to Standard capacity and credits
  • Standard = regular access; IA/Archive = less traffic
  • Lifecycle policies = automatically change class according to inactive time
  • IA/Archive has an access fee; Archive requires Regional + Elastic throughput. One Zone supports Standard/IA.

4. Practical example

Several WordPress EC2 instances use EFS to share uploaded images.

EBS gp3 for boot/app; io2 for databases; Instance Store for cache/scratch; Regional EFS for shared WordPress upload directory between multiple EC2s.

Details: trang EBS.

5. Comparison

EBS is AZ-scoped block storage; EFS is shared file storage; Instance Store is temporary host-attached storage.

Compare storage

StorageMain characteristics
EBSBlock storage over the network, in the same AZ as EC2. Keep data when stopped; terminate delete or keep depending on DeleteOnTermination, the default root is usually deleted.
Instance StoreDisk local, fast I/O. Data loss when stopping/hibernate/terminate or host failure; reboot still holds. Contains only reproducible data.
EFSManaged NFS/POSIX for Linux, multiple EC2 mounts. Regional EFS is shared across many AZs, capacity expands automatically.

EBS & EFS

Amazon EBS: persistent block storage

1. Concept

EBS provides network-attached disks for EC2 in the same AZ; data can persist independently of an instance according to its settings.

2. Purpose

Provide durable disk for EC2, used for operating system, filesystem and database.

3. How it works

Usage flow:

EC2
↓ attach block volume in the same AZ
EBS
↓
Filesystem/Database

Volume belongs to one AZ

  • EBS: block storage over the network.
  • Volume and EC2 must be in the same AZ; Usually a volume is attached to one instance, an instance can have many volumes.
  • Volume remains when the device is stopped.
  • When terminating, DeleteOnTermination decides whether to delete the volume; root is usually on, data volume is usually off.
  • Check the property instead of assuming that the data is always present.

Select volume type

TypeSuitable
gp3Universal SSD; Configure capacity, IOPS, and throughput separately
gp2Universal SSD; Baseline IOPS depends on capacity, small volumes have bursts
io1/io2Provisioned IOPS for stable I/O; io2 for databases needs low latency and high durability
st1HDD for large data, frequent sequential read/write
sc1HDD for rarely accessed data, prioritizing cost
  • SSD can be used as a boot volume; st1/sc1 is not used as a boot volume.
  • IOPS is the number of operations per second; throughput is the amount of data per second.
  • Database random I/O is different from processing large files sequentially.

EBS specifications

  • Limit according to AWS documentation check date 13/10/2026; Actual speed depends on EC2 instance, I/O size and volume configuration.
TypeCapacityMax IOPSMax throughput
gp21 GiB–16 TiB16.000250 MiB/s
gp31 GiB–64 TiB80.0002.000 MiB/s
io14 GiB–16 TiB64.0001.000 MiB/s
io2 Block Express4 GiB–64 TiB256.0004.000 MiB/s
st1125 GiB–16 TiB500500 MiB/s
sc1125 GiB–16 TiB250250 MiB/s
  • High level requires EC2/Nitro support and sufficient EBS bandwidth;
  • gp2 throughput depends on capacity. gp3 on Outposts has lower limits: 16 TiB, 16,000 IOPS, 1,000 MiB/s.

gp3 and volume expansion

  • gp3 baseline: Includes 3,000 IOPS and 125 MiB/s; performance can increase without buying more capacity merely for IOPS.
  • Elastic Volumes: Expand capacity or change volume type and performance while EC2 runs.
  • After expansion: The operating-system partition and filesystem may also need expansion to use the new space.
  • Billing: Based on provisioned capacity, not only stored bytes. Check current gp3 limits when configuring it.

Multi-Attach

  • io1/io2 supports mounting the same volume to up to 16 Nitro instances in the same AZ when the configuration is supported.
  • Machines can read/write, but the application must have locking and filesystem cluster-aware to avoid data corruption.
  • Multi-Attach does not turn EBS into a multi-AZ shared file system. Multiple Linux servers sharing the same files are often more suitable for EFS.

4. Practical example

A database on EC2 uses io2 for consistent I/O; its volume remains when the instance stops.

Boot disk/dev server: gp3. Database on EC2 needs consistent I/O: io2. Log or sequential big data: st1. Want to transfer AZ: snapshot and then create a new volume in the destination AZ.

5. Comparison

gp3 serves general SSD workloads; io2 supports demanding IOPS requirements; st1/sc1 prioritize HDD throughput.

Max IOPS/GiB & EBS RAID Ratio (RAID 0 vs RAID 1)

EBS typeMax IOPS / GiBMax IOPS / VolumeMax Throughput
gp3500 IOPS/GiB (above baseline 3,000 IOPS)80.0002.000 MiB/s
io150 IOPS/GiB64.0001.000 MiB/s
io2 Block Express1.000 IOPS/GiB256.0004.000 MiB/s
CriteriaRAID 0 (Striping)RAID 1 (Mirroring)
Mechanism & PurposeBanding data across multiple EBSs to aggregate IOPS and throughputRecord identical replication on 2 drives to increase drive redundancy
AWS Risks & RecommendationsOne volume error causes data loss in the entire RAID 0 array; Used when a single volume does not have enough bandwidth/IOPSLess necessary on EBS because each EBS volume is self-replicated on many devices in the same AZ (avoid RAID 5/6 due to I/O parity costs)
EBS snapshots, AMI & encryption

1. Concept

A snapshot captures disk data at a point in time; an AMI is a template for launching a new EC2 instance.

2. Purpose

Backup disk, create a consistent machine, and protect EBS data with encryption.

3. How it works

Snapshot

  • Snapshot: A point-in-time disk backup. The first stores used blocks; later snapshots store changes.
  • Deleting an old snapshot: Does not prevent restoring snapshots that remain.
  • Taking a backup: Detaching the volume is not required. Databases need pending writes flushed or a suitable backup process; snapshots do not include RAM.
  • Changing AZ or Region: Restore a volume in another AZ; copy the snapshot when changing Region.
  • Sharing accounts: Requires suitable sharing and KMS permissions. AWS-managed-key snapshots cannot be shared cross-account like customer-managed-key snapshots.

Backup features

FeaturesSolve the problem
Snapshot ArchiveSave rarely used backups at a lower cost; Restore usually takes 24–72 hours
Recycle BinRecover accidentally deleted snapshots/AMIs if retention rules are in place
Fast Snapshot RestoreVolumes created from snapshots have full performance immediately, avoiding first-read latency; There is an additional fee according to AZ
EBS Snapshot Archive
  • EBS Snapshot Archive is a lower-cost storage class for snapshots that rarely need to be restored, such as long-term backups.
CriteriaSnapshot StandardSnapshot Archive
PurposeBackup regularly, need to restore soonLong-term backup, rarely recover
Storage unit priceHigherLower; There is an additional restoration fee
How to saveIncremental: saves blocks changed after the first snapshotFull snapshot: the entire block has data at the time of the snapshot
Create volumesCan be used directly to create volumeMust restore to Standard first, may take up to 72 hours
Minimum durationThere is no minimum retention periodCharge for a minimum of 90 days
  • If you permanently delete or restore to Standard before 90 days, you will still have to pay the Archive fee for the remaining time.
  • Because Archive saves full snapshots, the billed capacity may be larger than the incremental version; Need to consider both capacity and restore fee.

AMI

  • AMI: EC2 creation sample: OS, software, configuration and disk information.
  • With EBS-backed AMI, disk data resides in EBS snapshots.
Install and configure EC2 → create AMI → Launch Template → ASG create the same machine
  • AMI has a Region scope; Copy to another Region before using there.
  • Update AMI and patches periodically, do not leave secrets in the image.

Amazon Data Lifecycle Manager (DLM)

  • Amazon DLM automatically create, retain and delete EBS snapshots / EBS-backed AMIs according to policy; No need to write your own Lambda or cron for a simple backup schedule.
EC2 + EBS volumes
↓ DLM policy: backup every day
EBS snapshots
↓ keep 7 days
Automatically delete expired snapshots
FunctionMeaning
ScheduleCreate scheduled snapshots or EBS-backed AMIs; Select resources by policy/tags
RetentionKeep by number of copies or time, depending on policy
DeleteDelete expired snapshots; deregister AMI and process related snapshots according to policy
CopyCopy snapshot to another Region according to support policy
  • DLM manages copies created by DLM itself; Do not self-manage snapshots/AMIs created in other ways and do not use Instance Store-backed AMIs.
  • Choose AWS Backup when you need centralized policies for multiple services.

EBS encryption

  • KMS protects volumes, snapshots, and data transfers between EC2/EBS.
  • Snapshots from encrypted volumes are also encrypted; volume created from encrypted snapshots hold encryption.
  • Do not turn on encryption directly on the old unencrypted volume: snapshot → copy encrypted snapshot → create a new encrypted volume → replace volume.
  • The role needs KMS permission to use the key.

EBS Encryption by Default, Snapshot Archive & Snapshot Lock

Mechanism on EBSFunctions & Rules to remember
EBS Encryption by DefaultSet at level Account for each Region so that all newly created EBS volumes and snapshots in that Region are automatically encrypted (use alias/aws/ebs or CMK)
EBS Snapshot ArchiveCheap full snapshot storage tier (min 90 days); If you want to create a volume, you must restore it to Standard first (it takes up to 72 hours). Snapshots stored on S3 are managed by AWS, so they are not visible in your S3 Console
EBS Snapshot LockLock to prevent deletion of snapshots by time in mode Governance (only people with special IAM permissions can remove it) or Compliance (absolutely immutable until expiration, including root)

4. Practical example

A team builds a patched golden AMI and uses it in an ASG launch template.

Golden AMI for ASG; cross-Region snapshot/copy for DR; Recycle Bin prevents accidental deletion; Convert legacy disk to encrypted volume using snapshot.

5. Comparison

Snapshots protect volumes; AMIs launch servers; encryption protects data and requires appropriate KMS permissions.

EBS vs EFS vs Instance Store

1. Concept

EBS is instance-attached disk storage, EFS is a filesystem shared by instances, and Instance Store is local storage tied to its host.

2. Purpose

Distinguish between private disks, shared files and temporary disks to avoid choosing the wrong place to save data.

3. How it works

Three ways to save data:

  • EBS = block volume for EC2
  • EFS = shared file system
  • Instance Store = temporary disk on the host

How does EFS work?

  • Create a mount target in AZ, enable NFS 2049 via SG and then mount from the Linux client.
  • EFS automatically increases/decreases capacity according to the file, without needing to allocate volume size first.
  • Regional EFS saves across multiple AZs for better fault tolerance.
  • One Zone is cheaper but doesn't want to lose the whole AZ.
  • Encrypt at rest using KMS;
  • You can turn on encryption in transit and use access points to limit paths/permissions.

Performance and EFS costs

  • General Purpose: The EFS performance mode for most applications needing fast responses.
  • Max I/O: For some highly parallel workloads, with higher response latency as a trade-off.
  • Elastic throughput: AWS adjusts data transfer capacity to usage.
  • Provisioned throughput: You specify the transfer capacity required.
  • Bursting throughput: Throughput depends on stored data and accumulated burst credits for temporary increases.
  • Lifecycle: Moves infrequently used files to IA/Archive for lower storage charges, with access charges and class-specific conditions.

Instance Store

  • Very fast because the disk is near the compute.
  • Data may remain after reboot but is lost when stopped, hibernate, terminate or otherwise hardware error.
  • Do not save single copies of important data; Use backup/replication or other data sources.

EFS Storage Classes, Throughput Modes & Performance Modes

EFS Storage ClassAccess characteristicsAZ range
EFS StandardFrequent access, low latencyMulti-AZ
EFS Standard-IALess access, reduced storage fees (with retrieval fee)Multi-AZ
EFS ArchiveRare data access, long-term storage with lowest cost on Multi-AZMulti-AZ
EFS One Zone / One Zone-IASave money on dev/build or renewable dataSingle-AZ
  • EFS Intelligent-Tiering Use Lifecycle Management to automatically transfer files to IA/Archive according to inactive periods and then return them to Standard when read again.
EFS configuration groupThe modes need to be distinguished
Throughput ModeElastic (self-scaling for fluctuating load, needs General Purpose) · Provisioned (capacity independent MiB/s reservation) · Bursting (scaled according to storage capacity + burst credits)
Performance ModeGeneral Purpose (lowest latency per operation, default recommendation) · Max I/O (very high parallelism but higher latency; does not support Elastic and One Zone)

4. Practical example

An image-processing application uses EBS for its OS, EFS for shared images, and Instance Store for temporary files.

WordPress or multiple ECS tasks need to see the same file: EFS. Private database on an EC2: EBS. Handles reproducible intermediate data: Instance Store. Windows SMB share: see FSx for Windows File Server.

5. Comparison

Choose by durability, protocol, and sharing requirements rather than capacity or price per GB alone.

Key comparison

CriteriaEBSEFSInstance Store
TypeBlock disk over the networkShared file system NFS/POSIXLocal block disk on the host
ShareUsually an EC2; Conditional Multi-AttachMultiple Linux clients mounted togetherAttach to instance/host
ScopeOne AZMulti-AZ Regional or One ZoneA host
After stop/host errorEBS retains data, except for configuration deletionIndependent of EC2All data may be lost
Used forBoot disk, databaseShared content, home directory, containersCache, buffer, scratch

ALB, ASG & Beanstalk

High availability & Elastic Load Balancing

1. Concept

A load balancer receives requests and distributes them to working application instances instead of relying on one instance.

2. Purpose

Split requests to multiple machines and keep the application running when one machine or AZ fails.

3. How it works

Scalability and High Availability

ConceptApproach
Vertical scalingSwitch to a more or less powerful instance.
Horizontal scalingAdd or remove instances.
High Availability (HA)Provide spare resources and a way to switch to healthy resources.
  • A larger instance adds capacity but remains a single point of failure.
  • Web applications commonly use a load balancer and an ASG across AZs for load distribution and fault tolerance.

What does Load Balancer do?

  • The load balancer receives the connection from the client and then transfers it to the downstream target.
  • ELB: managed service: AWS operates the load balancer infrastructure, you configure listener, target and health check.
Client → Route 53 → Load Balancer
                    ├─ healthy target in AZ A
                    └─ healthy target in AZ B
  • Internet-facing load balancer receives traffic from the Internet; internal load balancer serves connection in private network.
  • Clients often use DNS names, not fixed ALB IPs.

Check health and remaining capacity

  • Health Check: Tests whether a server can serve traffic to avoid sending requests to failed targets under normal conditions.
  • Losing an AZ: Remaining AZs need enough capacity for the redirected traffic.
  • New instances: ELB distributes requests rather than launching EC2. Use an ASG or another scaling mechanism.
  • Data and sessions: Databases, files, and session state also need resilience. Shared session storage lets users continue when another server handles requests.

4. Practical example

A website runs EC2 instances in two AZs; new requests go to healthy instances when one fails.

Web/API has many EC2/ECS tasks: ELB shares load, ASG manages number of machines. Microservice private: internal ALB/NLB. Use Route 53 Alias ​​to point the domain to ELB, ACM for TLS and CloudWatch for monitoring.

5. Comparison

A load balancer distributes traffic; an ASG changes fleet size; high availability also requires resilient backends and data.

ALB vs NLB vs GWLB

1. Concept

ALB handles web requests, NLB handles network connections, and GWLB routes traffic through security appliances.

2. Purpose

Choose load balancer according to protocol and how traffic needs to be handled.

3. How it works

Simply understand the 4 types of Load Balancers

Type

Understand simply

When to choose?

ALB

Delivered according to HTTP request content

Website, API, Microservices

NLB

Distributed by network connection, supporting static IP

TCP/UDP, game, IP allowlist

GWLB

Pass traffic through the security checking system

Firewall, IDS/IPS

CLB

Old Load Balancer

Legacy applications

ALB — Application Load Balancer (Layer 7)

  • ALB understands the HTTP request content so it can route by URL, hostname, header...

For example:

Client
   ↓
ALB (HTTPS)
   │
   ├── /users  → EC2 User Service
   │
   ├── /orders → EC2 Order Service
   │
   └── /images → Lambda
  • An ALB can serve multiple microservices through Target Groups.

NLB — Network Load Balancer (Layer 4)

  • NLB distributes network connections, not URL parsing like ALB.
Game Clients
      ↓
 NLB (UDP/TCP)
      │
      ├── Game Server A
      ├── Game Server B
      └── Game Server C

Special:

  • Supports static IP according to AZ.

  • Elastic IP can be assigned to Internet-facing NLB.

  • Suitable for TCP, UDP, TLS protocols and workloads that require low latency.

  • NLB → ALB can be set when both static IP and HTTP routing are needed.

GWLB — Gateway Load Balancer (Layer 3)

  • GWLB does not primarily deliver HTTP requests to the application, but rather sends traffic through security appliances.
Internet
    ↓
Gateway Load Balancer
    ↓
Firewall / IDS / IPS
    │
    ├── Appliance A
    └── Appliance B
    ↓
Application
  • For example: The company wants all traffic to be inspected by a third-party firewall before reaching EC2.
  • GWLB uses GENEVE, UDP port 6081 to transfer traffic to appliances

4. Practical example

A website uses ALB to route /orders and /images to separate backends; a UDP game needs a different balancer.

5. Comparison

ALB understands HTTP; NLB handles TCP/UDP; GWLB steers packets through security appliances.

ELB targets, health, sessions & TLS

1. Concept

A load balancer uses listeners, rules, and target groups to receive requests, select destinations, and check target health.

2. Purpose

Route requests to suitable servers and replace servers during updates with less disruption to users.

3. How it works

Request flow:

Client
↓ TLS / Listener
Load Balancer
↓ Rule → Target Group
Healthy Target

Listener, rule and target group

ComponentRole
ListenerAccepts traffic on a protocol and port, such as HTTPS on port 443.
RuleSelects the target group for a request.
Target groupContains backends and health check configuration.

Health check:

  • Where to check: a port and path, such as /health.
  • When to check: the configured interval and healthy/unhealthy thresholds.
  • What counts as success: the HTTP codes in the matcher, not always just 200.
  • Endpoint design: reflect whether the application can actually serve requests.

Security Group and IP client

Security groups:

  • Client → ALB: allow the required port in the ALB security group.
  • ALB → backend: allow the ALB security group as the source in the application security group on backend and health check ports.
  • Backend: it does not need unrestricted Internet exposure.
TypeHow does the application identify the user's IP?
ALBALB sits between the user and application. It normally adds the user's IP to the request's X-Forwarded-For field; the application reads that field.
NLBCan keep the user's IP when forwarding a connection. Support depends on configuration and connection type; otherwise, the application sees the NLB's IP.
  • Example: A customer with IP 203.0.113.10 accesses an ALB; the application finds that IP in X-Forwarded-For. Trust only IP information added by the ALB or a trusted intermediary.
  • Identifying an IP does not replace security group rules that allow or block connections.

Sticky session

  • ALB stickiness uses cookies to keep a client on a target: cookies created by LB such as AWSALB or application-based cookies.
  • NLB stickiness uses source IP when supported, not HTTP cookies.
  • Stickiness can distort the load and not protect the session when the target dies.
  • Saving sessions in ElastiCache/DynamoDB helps machines share the same state. ALB sticky sessions.

Cross-zone load balancing

Cross-zoneTraffic destination
EnabledA load balancer node can send traffic to targets in other AZs.
DisabledA node sends only to its own AZ; unequal instance counts across AZs can create uneven per-instance load.
  • ALB: enabled at load balancer level, adjustable at target group level.
  • NLB/GWLB: disabled by default.
  • Cost: transfer charges vary by load balancer type; check before deployment.

TLS and SNI

HTTPS encrypts data in transit. To encrypt the whole path, enable it on both connections:

  1. User → load balancer: use HTTPS.
  2. Load balancer → application server: also use HTTPS.
  • Example: A customer sends a password to ALB over HTTPS. If ALB forwards it over HTTP, that application-server connection is still unencrypted.
  • ACM: issues and manages HTTPS certificates.
  • SNI: tells ALB/NLB the website name so it can select the right certificate. CLB does not support this multi-certificate selection.

4. Practical example

Example: Update server A while customers submit orders.

  1. The load balancer sends new requests to other servers.
  2. Server A gets time to finish existing requests.
  3. Remove A when work finishes or the wait expires. Configure the application not to stop immediately.
  • Deregistration delay: this waiting period; ALB defaults to 5 minutes (300 seconds), which you can change.
  • Use it for updates or fewer servers; it cannot rescue an already failed server.

5. Comparison

  • Sticky session: tries to send the same user to the same server.
  • Health check: checks whether a server can still serve requests.
  • Deregistration delay: lets a departing server finish existing requests.
Auto Scaling Groups & Launch Templates

1. Concept

An Auto Scaling group maintains EC2 instances according to your desired count and launch configuration.

2. Purpose

Automatically maintain the required number of EC2 instances and recreate instances with a consistent configuration.

3. How it works

Minimum, desired and maximum

ValueMeaning
MinimumThe minimum instance count.
DesiredThe instance count the ASG tries to maintain.
MaximumThe upper instance-count limit.
  • Replacement: when an instance terminates or becomes unhealthy, the ASG launches a replacement to restore desired capacity.
  • AZ resilience: select subnets in multiple AZs to distribute instances.
  • Data: the ASG does not protect data stored only on a deleted instance; use stateless applications or external storage.

Launch Template & Instance Refresh

  • Launch Template: The configuration used to create EC2 instances, including AMI, Instance Type, Security Group, IAM Instance Profile, User Data, Key Pair, and Storage.
  • Auto Scaling Group (ASG): Uses the Launch Template to create EC2 instances and specifies the Subnet, AZ, and Target Group.
  • Launch Template Version: Manages multiple configuration versions. Changing the version does not automatically update running EC2 instances.
  • Instance Refresh: Gradually replaces old EC2 instances with new ones using the updated configuration, while maintaining capacity to reduce disruption.

Flow:

Launch Template (AMI, Instance Type, SG...)
        ↓
Auto Scaling Group (Subnet, AZ, Target Group)
        ↓
EC2 Instances

When updating the configuration:

Launch Template V1 → Launch Template V2
                            ↓
                     Instance Refresh
                            ↓
               Gradually replace old EC2 instances

ASG and ELB

Launch Template → ASG creates EC2 → registers target group → ELB sends request
                       ↑
          health check / scaling policy
  • ASG uses EC2 health check and can turn on ELB health check to replace devices that the app cannot serve.
  • Need health check grace period to not delete bootstrap device.

Controlled launch and termination

  • Lifecycle hook: Pauses ASG instance launch or termination so required work can finish.
  • Launch example: Install and check the application before the instance starts taking work.
  • Termination example: Finish ongoing work or connections before the instance shuts down.
  • Mixed Instances Policy: Lets an ASG combine instance types and On-Demand/Spot to improve capacity availability and cost.

4. Practical example

A website requires at least two EC2 instances; its ASG replaces an unhealthy instance.

Web fleet multiple AZs after ALB; SQS processing worker can create/delete according to backlog; Patch rollout using new AMI and Instance Refresh.

5. Comparison

A launch template describes instances; the ASG manages the fleet; scaling policies change desired capacity.

ASG scaling policies, metrics & cooldowns

1. Concept

Scaling policies add or remove EC2 instances based on usage metrics or schedules.

2. Purpose

Increase capacity when lacking capacity and reduce capacity when excess, based on signals reflecting application load.

3. How it works

Stream scales according to load:

Metric / Alarm
↓ Scaling Policy
Auto Scaling Group
↓ increase or decrease desired capacity
EC2 instances

Scaling types

PolicyHow it worksFor example
Target trackingKeep metrics close to targetAverage CPU is about 50%
Step scalingThe more you exceed the threshold, the stronger the increaseCPU 70–85% add 1; above 85% add 3
Simple scalingAn alarm triggers a change, then waits for a cooldownHigh CPU → add 2 machines
ScheduledChange capacity according to known scheduleAdd machines before peak hours
PredictiveForecast from historical patterns to prepare in advanceThe load increases repeatedly every morning

Select metrics

MetricSuitable workload
CPUA CPU-bound application.
ALBRequestCountPerTargetA web application with reasonably similar requests.
Network metricA bandwidth-bound workload.
SQS backlog per instanceQueue workers; measure pending messages per worker rather than only total messages.
  • SQS example: 1,000 messages with 2 workers impose a different load from 1,000 messages with 100 workers.
  • Target tracking: the metric must reflect usage per unit of capacity.

Warmup, grace period and cooldown

ConceptPurpose
WarmupLets a new instance stabilize before being appropriately included in scaling decisions.
Health check grace periodPrevents an instance from being judged unhealthy too soon after launch.
CooldownMainly used for simple scaling to avoid repeated reactions before earlier scaling takes effect.
  • Target tracking and step scaling use warmup.
  • There is no universal rule that all scaling is locked for 300 seconds.

Increase quickly, decrease cautiously

  • Fast startup: Prepare an AMI with software installed so new instances become ready sooner.
  • Scaling in: Allow requests and jobs to finish before removing instances; use deregistration delay or lifecycle hooks where needed.
  • Scale-out limit: Set a sufficient maximum and monitor quotas and AWS capacity availability.

4. Practical example

Order-processing workers scale out when the queued messages per worker exceed their target.

Web volatility: target tracking. Campaign knows start time: scheduled. SQS backlog grows very fast: step scaling or target tracking on backlog per worker.

5. Comparison

Target tracking maintains a metric target; step scaling responds to threshold ranges; scheduled scaling follows a timetable.

AWS Elastic Beanstalk

1. Concept

Elastic Beanstalk deploys an application to AWS and manages the infrastructure needed to run it.

2. Purpose

Elastic Beanstalk helps deploy web applications to AWS quickly without having to manually build each part such as EC2, Auto Scaling, Load Balancer and monitoring.

3. How it works

Code
↓
Elastic Beanstalk
↓
EC2 + ASG + Load Balancer

Elastic Beanstalk = PaaS, not serverless.

How it works

  • Developers mainly worry about: Application Code
  • Beanstalk supports: Provision infrastructure · Deploy application · Auto Scaling · Load Balancing · Health Monitoring
  • Support: Java · .NET · Node.js · Python · Go · PHP · Docker
  • You can still access and configure the resources below.

Web Server Tier

  • Used for web/API to receive HTTP requests.
Client
↓
Load Balancer
↓
EC2 in Auto Scaling Group
  • Suitable: Website · REST API · Synchronous Request

Worker Tier

  • Used for background jobs.
Web App
↓
SQS
↓
Worker Environment
↓
Process Job

For example:

  • Send Email · Resize Image · Generate Report

Web Tier = HTTP Worker Tier = SQS + async job

Deployment

  • Important deployment types: Rolling = update each group of instances
  • Immutable = create a new instance and replace the old instance
  • Traffic Splitting = divide traffic between old and new versions

Database

Production database should be separate from the Beanstalk lifecycle:

Elastic Beanstalk
↓
Application
↓
Private RDS
  • → Terminating the environment does not destroy the production database.

Cost

  • Elastic Beanstalk itself has no separate fees.
  • You pay for the resources below: EC2 · Load Balancer · RDS · S3 · ...

AWS App Runner

  • AWS App Runner Run web applications or APIs from source code or container images without needing to manage EC2, ECS or Kubernetes yourself. Services take care of infrastructure, deployment, load balancing, HTTPS endpoint and automatic scaling.
Java Spring Boot REST API
↓
Source code / Container image
↓
AWS App Runner
↓ self-deploy and self-scale
HTTPS Endpoint
↓
Users calls GET /products
  • For example, package the Spring Boot backend into a container image on ECR, deploy with App Runner for users to call GET /products. App Runner matches the receiving application HTTP requests; Scheduled batch jobs should use a dispatch service like AWS Batch combined with EventBridge Scheduler.
  • Compared to Beanstalk, App Runner reduces web/container infrastructure management;
  • Beanstalk allows accessing and customizing the underlying EC2/ASG/Load Balancer resources.
  • Updated from April 30, 2026: App Runner is not accepting new customers; Existing customers continue to use it. AWS recommends ECS Express Mode for new needs; still keep the App Runner concept to learn SAA-C03 material.

4. Practical example

A team uploads its web application; Beanstalk creates the configured EC2, load-balancing, and Auto Scaling environment.

  • Team wants to deploy web app quickly but still uses EC2/ASG.
  • The Web tier writes the job to SQS and the Worker tier processes it.
  • Traditional applications need a managed platform rather than building the infrastructure yourself.

5. Comparison

Beanstalk manages application environments; App Runner simplifies running web/container applications; ECS manages container orchestration.

Compare App Runner vs Elastic Beanstalk vs ECS Express Mode & Deployment Type

ServiceInputInfrastructure management level
AWS App RunnerSource code or Container imageFully managed (HTTPS, scaling, automatic LB); Minimum configuration required
AWS Elastic BeanstalkApplication code / packageAWS builds EC2 + ALB + ASG but you still retain SSH/customization of the underlying EC2
ECS Express ModeContainer image + IAM RolesQuickly create ECS Service yourself on Fargate + ALB + Auto Scaling + HTTPS in your account
Rolling Deployment → Gradually replace instances/tasks on the existing environment
Blue/Green Deployment → Create a new environment in parallel and then transfer traffic (instant rollback)

RDS, Aurora & ElastiCache

Amazon RDS fundamentals & operations

1. Concept

RDS runs relational databases such as MySQL or PostgreSQL and manages servers, system updates, and configured backups.

2. Purpose

Run a relational database without having to manage the entire server, patches and backups yourself.

3. How it works

Database flow:

Application
↓ Database endpoint
RDS
↓
Managed database / storage / backup

What does RDS manage, what do you manage?

  • RDS supports engines such as MySQL, PostgreSQL, MariaDB, Oracle, SQL Server and Db2;
  • Aurora is a MySQL/PostgreSQL compatible option with its own architecture.
  • AWS takes care of provisioning, OS patching, and configured managed features.
  • You still design the schema, query, index, database users, capacity, backup retention and network security.

Configure database

  • Select engine/version, instance class, storage, subnet group, SG, parameter/option group and maintenance window.
  • Set DB in private subnets; Just put the SG app into the database port.
  • Changing instance class increases CPU/RAM; Add replica extension read.
  • Storage Auto Scaling increases disk within the set maximum storage, does not automatically increase CPU and does not automatically reduce disk.

Storage Auto Scaling

  • RDS increases storage when low free space is persistent and enough time has elapsed since the previous change.
  • Typical conditions: less than 10% left, lasts at least 5 minutes, has been at least 6 hours since the change or storage optimization has been completed, set a later date.
  • Set maximum large enough and alarm monitors storage.
  • Auto Scaling does not replace data cleaning or capacity planning.

RDS vs. EC2 and RDS Custom

  • RDS usually does not allow SSH into the OS.
  • DB on EC2 gives more control but you take care of patching, backup and HA yourself.
  • RDS Custom for Oracle/SQL Server needs deeper customization in OS/database.
  • Changes must still be within the scope of support and coordination with the service's automation.

CloudWatch and Enhanced Monitoring

RDS monitoring modeCollection Cycle & Mechanism
RDS CloudWatch Metrics (Default)Send metrics at each hypervisor/database layer 1 minute (no need to enable EC2 Detailed Monitoring)
Enhanced MonitoringThe agent right on the DB instance collects deep OS/process metrics with cycles down to 1 second and send it back CloudWatch Logs (need monitoring IAM role)
  • RDS CloudWatch metrics: Report database/hypervisor metrics every minute without EC2 Detailed Monitoring.
  • Enhanced Monitoring: An agent on the DB instance collects deeper OS and process metrics at intervals down to one second; a monitoring IAM role is required.
  • Viewing data: The console refreshes as often as every five seconds. Read CloudWatch Logs for the one-second collection data.

RDS Storage Types, Parameter Groups, Private Endpoint & RDS Custom

RDS StoragePerformance characteristics
gp2Previous General Purpose SSD; IOPS is tied to capacity + burst credits
gp3General Purpose SSD; Separately configure IOPS and throughput independently of capacity
io1 / io2 Block ExpressProvisioned IOPS SSD reserves stable, low-latency IOPS for heavy DB workloads
RDS componentsFunctions & Distinguishing Points
RDS Parameter GroupsWhere to configure engine parameters and DB security (eg limit connections, force SSL/TLS connections like rds.force_ssl)
RDS Private EndpointDNS hostname of DB resolves to Private IP in subnet when Public Access is turned off (not Interface VPC Endpoint)
RDS Custom for Oracle / SQL ServerManaged service but allows permissions privileged OS & DB access to install third-party software/plugins or use special BYOL

4. Practical example

A store keeps orders in RDS PostgreSQL instead of installing and patching PostgreSQL on EC2.

Web needs managed PostgreSQL/MySQL: RDS. Enterprise software needs OS customization: consider RDS Custom. Need HA: add Multi-AZ; need to reduce reading load: Read Replica; need to reduce repeated queries: cache.

5. Comparison

RDS manages many operational tasks; a database on EC2 offers deeper control with more operational responsibility.

RDS Multi-AZ & Read Replicas

1. Concept

Multi-AZ provides failover capacity when a database fails; read replicas take read queries off the primary database.

2. Purpose

Distinguish fault-tolerant solutions from solutions that increase read capacity.

3. How it works

Distinguish between two needs:

  • Multi-AZ = fault tolerance/failover
  • Read Replica = increased read load

Multi-AZ DB instance

  • Primary: The main database instance serving application queries.
  • Standby: An instance in another AZ receiving synchronous copies without serving reads.
  • Primary failure: RDS automatically fails over and updates the connection endpoint. Applications must reconnect, retry, and handle interrupted transactions.
  • Scope: Protects within one Region; does not replace backups for accidental deletion or cross-Region recovery.

Multi-AZ DB Cluster

  • Writer: One instance accepts writes.
  • Readers: Two instances in the other AZs can serve reads.
  • Replication: Semisynchronous: a write is acknowledged after at least one reader receives the change.
  • Writer failure: A reader can automatically take over as writer.
  • Compared with a DB instance: A Multi-AZ DB instance standby cannot serve reads; the cluster's two readers can.

Read Replica

  • Read Replica: A separate read-serving copy with its own application endpoint.
  • Freshness: Receives changes after the primary and can lag. Use the primary when the latest data is required.
  • Primary failure: An ordinary replica does not take over automatically. Promotion makes it independent and stops following its old source.
  • Location and count: Same- or cross-Region support, replica counts, and features depend on the engine.
  • Transfer cost: In-Region replication transfer is free where supported by RDS; cross-Region transfer is charged.

4. Practical example

An online store writes orders to the primary, sends reports to a Read Replica, and uses Multi-AZ for automatic failover.

DB production needs to failover itself when AZ fails: Multi-AZ. Heavy reports slow down transactions: Read Replica. Users in other Regions need to read more closely or have DR: cross-Region replica with promotion plan.

5. Comparison

  • A Multi-AZ DB instance has a non-readable standby;
  • Read Replicas serve reads;
  • a Multi-AZ DB cluster has two readers and automatic failover.

Key comparison

CriteriaMulti-AZ DB instanceRead Replica
TargetAvailability and automatic failoverRead scaling, reporting, can support DR
ReplicationSynchronous to standby in another AZAsynchronous, has replica lag
Standby serving reading?NoThere is an endpoint for the app to send read queries
When primary failsRDS moves the endpoint to standbyPromote according to the appropriate process, change the app endpoint

RTO, RPO, and failover

  • The RTO/RPO examples below compare recovery mechanisms rather than guarantee every failure outcome.
  • Engine, configuration, lag, and failure type matter; applications still need reconnect/retry logic and failover tests.
Deployment modelCommon RTORPOFailover Mechanism
RDS Read ReplicaSeveral minutes or moreDepends on replication lagManual promotion
RDS Multi-AZ DB Instance60–120 seconds0 (synchronous)Automatic
RDS Multi-AZ DB ClusterUnder 35 seconds0 (semi-sync quorum)Automatic
Aurora DB Cluster + ReplicaUsually less than 30 seconds0 (shared storage 6 copies/3 AZ)Automatic
Aurora Global Database (Cross-Region)Under 1 minute (managed)Usually < 1 second (async)The Managed/Manual Failover step needs to be enabled to promote the secondary cluster

Migration with less downtime: can create Aurora Read Replica directly from the running RDS MySQL/PostgreSQL, wait for replication to catch up and then promote to the independent Aurora cluster.

Amazon Aurora architecture & scaling

1. Concept

Aurora is MySQL/PostgreSQL-compatible; query-processing instances share a storage layer that maintains multiple data copies.

2. Purpose

Use a MySQL/PostgreSQL compatible database with distributed storage and integrated read scaling.

3. How it works

Two access routes:

Write → Writer endpoint → Primary instance
Read → Reader endpoint → Aurora Replicas
Compute → shared distributed storage

Compute is separate from storage

  • Database instance: The machine executing queries. Aurora typically has one writer and up to 15 readers (Aurora Replicas).
  • Storage: Instances share a storage layer whose capacity grows with the data.
  • Data protection: Storage keeps six copies across three AZs and repairs failed copies. These are data copies, not six database instances.
  • Quorum: The agreement mechanism is commonly described as four copies for writes and three for reads, rather than waiting for all six.

Writer and Reader endpoints

EndpointUse when
Writer/cluster endpointWrite or read-write; Points to the current writer
Reader endpointDistribute read connections across replicas
Instance endpointNeed a specific instance
Custom endpointSplit replica groups for a workload
  • The Reader endpoint is balanced at the connection level, not dividing each SQL query itself.
  • Without a replica, the reader endpoint can point to the writer; Do not consider the endpoint name as a read-only enforcement mechanism.

Failover

  • When the writer fails, Aurora can promote the replica and update the writer endpoint.
  • Placing the replica in another AZ helps restore compute faster; Multi-AZ storage by itself does not guarantee uninterrupted connectivity.
  • App still needs reconnect/retry.
  • Actual failover time depends on the situation; don't consider the quick numbers in the slide as an SLA for every defect.

Auto Scaling and custom endpoints

  • Aurora Auto Scaling: Adds or removes readers based on metrics such as CPU or connections to handle more reads.
  • Serverless v2: Changes the processing resources of an instance, rather than the number of readers.
  • Custom endpoint: Connects to a selected group of instances, such as stronger readers reserved for heavy reports.
  • Reader endpoint: Remains available for distributing read connections; the application chooses the endpoint appropriate for the work.

4. Practical example

A SaaS application writes transactions through the writer endpoint and runs reports on Aurora readers.

OLTP requires MySQL/PostgreSQL-compatible and HA; Read-intensive SaaS uses reader endpoint; Separate reporting from transaction query using replica/custom endpoint.

5. Comparison

The reader endpoint distributes read connections; the writer endpoint follows the current writer; an instance endpoint targets one instance.

Aurora Serverless, Global & advanced capabilities

1. Concept

Aurora can adjust processing capacity, maintain data in another Region, and create separate copies for testing.

2. Purpose

Handle demand spikes, serve distant users, and test changes without editing live data.

3. How it works

Aurora Serverless v2

  • How it works: adjusts processing power within your limits. You still configure the engine, network, and security.
  • Example: a shop gains processing power during a sale and reduces it afterward.
  • Difference: changes each instance's power rather than adding read-only instances.
  • Pausing when idle: requires a supported version and configuration.

Aurora Global Database

  • How it works: writes in one AWS Region are copied elsewhere for nearby reads.
  • Example: an order may be lost if the primary fails before the backup location receives it.
  • Recovery: switch the backup location to accept writes. Test possible data loss and recovery time.
  • Multi-AZ: provides in-Region redundancy, not a substitute for cross-Region recovery.

Database Cloning

  • Purpose: create a test copy; editing it does not change the original.
  • Fast creation: initially shares data and stores changed portions separately.
  • Example: test a table change or run a heavy report on the copy.
  • Remember: has separate compute and costs; does not replace recovery backups.

Babelfish and Machine Learning

  • Babelfish: helps SQL Server applications move to Aurora PostgreSQL with fewer code changes.
  • Example: reuse many existing sales-app statements; test because compatibility is not complete.
  • Machine learning: Aurora calls AI services such as SageMaker or Comprehend; requires supported versions and configuration.
  • Example: ask AI whether comments are positive or negative. The database sends data and receives results; it does not teach itself.

4. Practical example

Example: A shop uses Serverless v2 to increase database processing power during a sale. Before changing its orders table, the team creates a separate test copy with cloning.

5. Comparison

  • Serverless v2: increases or decreases each instance's processing power.
  • Reader Auto Scaling: adds or removes instances to share reads.
  • Global Database: keeps data in other Regions for distant users and disaster recovery.

Aurora Standard vs Aurora I/O-Optimized

Configure Aurora StorageHow to calculate feesWhen is it optimal?
Aurora StandardCharge for GB-month capacity + charge per read/write I/O operationWorkload has a moderate amount of I/O
Aurora I/O-OptimizedCompute & storage prices are higher but Completely free for each I/O requestI/O overhead exceeds approx 25% of total Aurora bill or need to forecast stable costs for large I/O loads
RDS/Aurora backup, restore, security & RDS Proxy

1. Concept

Backups restore data, security controls restrict access, and RDS Proxy lets applications reuse database connections.

2. Purpose

Restore data, protect connections and avoid database being overloaded by many connections.

3. How it works

Automated backups and snapshots

  • Automated backup combines backups with transaction logs for Point-in-Time Restore (PITR) in the retention window.
  • RDS DB instances support retention for up to 35 days; Set 0 to disable automated backup in enabled models.
  • Aurora keeps continuous backups according to configured retention.
  • Manual snapshots are kept until they are automatically deleted.
  • Restore creates a new DB/cluster, does not overwrite the running DB; must move the application to the new endpoint after checking the data.

Restore and migrate

Wrongly deleting data → PITR before the problem → new DB → check → change app endpoint
  • Some MySQL restores from S3 use backups created by Percona XtraBackup, requiring correct version/format support.
  • You don't have to upload any dump files to S3 to restore.
  • Snapshot is different from read replica: replica can replicate mistakenly deleted operations, while backup allows returning to a previous point in time.

Network, credentials and encryption

Set DB private, SG only receives from app.
TLS encryption in transit; KMS encrypts when saving and backing up.
If you want to encrypt the old database, usually snapshot → encrypted copy → new restore.
  • Secrets Manager saves/rotates passwords; IAM DB authentication uses tokens for DB users configured on the supporting engine.
  • RDS API management permissions do not automatically grant permissions to run SQL in the DB.

RDS Proxy

  • Proxy pool/reuse connection, useful when Lambda/application opens many short connections.
  • The proxy resides in the VPC, helping to reduce connection storms and improve failover handling; Does not cache SQL results or make heavy queries automatically faster.
Lambda/EC2 → RDS Proxy → connection pool → RDS/Aurora
  • Passwords can be used with Secrets Manager or IAM authentication according to supported configuration.
  • IAM is not always required for clients; End-to-end IAM can also unstore passwords in Secrets Manager. AWS RDS Proxy authentication.

Operational events and data events

  • RDS Event Notifications/EventBridge reports DB events such as failover, snapshot creation or state change; Not a stream that changes each row.
  • Some engines support calling Lambda from SQL/DB logic.
  • Requires both IAM permission and network connection to Lambda; Private DB can use NAT/VPC Appropriate endpoints.
  • If you need CDC, use the CDC tool/stream, don't rely on lifecycle notifications.

IAM Database Authentication & Cross-VPC RDS Proxy

Authentication/Connection mechanismHow it Works & Conditions
IAM Database AuthenticationAuthenticate into RDS/Aurora (MySQL, PostgreSQL, MariaDB) using Temporary auth token is valid for 15 minutes instead of static password; Request to enable features on the DB, create the corresponding DB user (eg AWSAuthenticationPlugin on MySQL), IAM permissions rds-db:connect and connect via TLS (open connection is not terminated when token expires 15 minutes)
Cross-VPC RDS Proxy EndpointAllow Lambda/EC2 in VPC A to connect to RDS Proxy and Private RDS in VPC B via ENI + Private IP (AWS PrivateLink) without needing to open a public DB or combine CIDR across the network
EC2 / Lambda (IAM Role with rds-db:connect)
  ↓ Generate IAM Auth Token (15 minutes)
  ↓ TLS connection
RDS / Aurora (reconcile DB User + IAM Token)

4. Practical example

Thousands of Lambda invocations connect through RDS Proxy to reduce direct RDS connections.

Accidentally deleted recovery: PITR. Lambda opened too many connections: RDS Proxy. DB security: private subnet + SG + TLS + KMS + secret management. Failover warning: RDS event → SNS/EventBridge.

5. Comparison

RDS Proxy manages connections, ElastiCache keeps data in memory, and PITR restores data to a point before an incident.

Amazon ElastiCache

1. Concept

ElastiCache keeps data in memory for fast access and fewer database queries.

2. Purpose

Keep frequently used data in RAM for quick response and reduce the number of database queries.

3. How it works

Cache-aside

App → cache: has data → returns results
          └─ not available → read DB → write cache with TTL → return result
  • The application must add cache read/write logic; ElastiCache does not front itself database like RDS Proxy.
  • Select TTL and invalidation to avoid returning old data for too long.
  • Write-through updates the cache at the same time as writing to the DB, making data available for reading but increasing write work and possibly caching unused data.
  • Cache-aside only loads when needed but the first read has a cache miss.

Redis/Valkey and Memcached

ChooseMain point
Redis OSS/ValkeyData structures, sorted sets, replication/read replicas, Multi-AZ failover and snapshots depending on configuration
Node-based MemcachedSimple key-value cache, sharding, multi-thread; no native replication/failover like Redis
  • Node-based Memcached does not have backup like Redis/Valkey; Serverless Memcached has snapshot/restore support.
  • So we need to look at both the engine and the deployment model. AWS backup support.

Sessions and leaderboards

  • Storing sessions in cache helps multiple app instances share the same login state.
  • Redis/Valkey sorted sets are suitable for leaderboards because they store scores and query rankings quickly.
  • Common read cache reduces repeated queries on RDS.
  • Read Replica still runs SQL on the DB data; cache stores results/objects for quick retrieval, two solutions can be used together.

Security and data may be lost

  • Use private network, source-limited SG, TLS and appropriate authentication engine/version: AUTH/RBAC or IAM authentication when supported.
  • IAM cluster management and IAM data authentication are different permissions/configurations.
  • Designed to tolerate cache misses or cache data loss; For data that needs to be sustainable, there must be a data source/backup that meets the requirements.
  • Asynchronous replication does not guarantee that all writes will not be lost in case of error.

4. Practical example

A product page reads prices and descriptions from cache; on a miss, the application reads RDS and fills the cache with a TTL.

Product catalog read a lot: cache-aside. Multiple EC2 web needs common session: Redis/Valkey. Game ranking: sorted sets. Simple, renewable cache: Memcached.

5. Comparison

A Read Replica still executes database queries; a cache stores results or objects; RDS Proxy only manages connections.

Purpose-Built Databases

Amazon DocumentDB

1. Concept

DocumentDB stores records as documents with fields; records do not need exactly the same fields.

2. Purpose

Store flexible document records without operating the database cluster.

3. How it works

  • Amazon DocumentDB is a managed document database compatible with MongoDB API, used to store data in JSON document format with flexible schema.
  • DocumentDB = Document Database = MongoDB-compatible = Managed by AWS

Document Model

  • Document: A JSON-like record, such as a product's information.
  • Flexible fields: A phone has a color; a laptop has RAM and CPU fields. Both products need not have identical fields.
  • Compared with RDS/Aurora: Relational databases organize data into tables, rows, columns, and an explicit schema.
Product A
{
  name: "Phone",
  color: "Black"
}

Product B
{
  name: "Laptop",
  ram: "16GB",
  cpu: "M3"
}

MongoDB Compatibility

Applications can use:

MongoDB Driver
↓
DocumentDB
  • But remember: DocumentDB ≠ MongoDB self-hosted
  • DocumentDB = AWS service compatible with MongoDB API
  • So still need to check which MongoDB features are supported.

Managed Cluster

  • AWS admin: Provisioning · Patching · Backup · Replication · Storage scaling
  • Application still has to worry about: Document Design · Indexes · Queries · Security

Availability & Storage

DocumentDB has replication across multiple AZs:

Application
↓
DocumentDB Cluster
↓
Replicas across AZs
  • Objective: High Availability + Failover
  • Storage can expand automatically as data increases.

Index

  • If you want to query quickly, you still need an index.
Query by email
↓
Index: email
↓
Search faster

If there is no suitable index:

Full Scan
↓
Query is slow

Managed database does not mean automatically optimized queries.

Security

DocumentDB typically runs in:

VPC
↓
Security Group
↓
TLS
↓
DocumentDB Cluster
  • IAM is used to manage AWS resources, but permissions to read/write database data still require appropriate authentication/authorization mechanisms.

Document Size & DocumentDB Serverless

  • DocumentDB supports maximum document size 16 MB and there is a regime DocumentDB Serverless Self-scaling capacity every second based on DCU.

4. Practical example

A product catalog stores documents because each product type has a different set of attributes.

Product Catalog
↓
DocumentDB
User Profile
↓
DocumentDB
CMS / Content Metadata
↓
DocumentDB
MongoDB-compatible Application
↓
DocumentDB

5. Comparison

DocumentDB uses documents and MongoDB-compatible APIs; RDS uses SQL relations; Neptune focuses on graphs.

DocumentDB vs RDS vs Neptune

  • RDS / Aurora = SQL = relational = join multiple tables
  • DocumentDB = JSON document = flexible schema = MongoDB-compatible
  • Neptune = Graph Database = relationship / traversal
Bank Transaction
→ RDS / Aurora

Product Catalog
→ DocumentDB

Social Network Relationship
→ Neptune
Amazon Neptune

1. Concept

Neptune stores entities and their relationships, such as people and their friendships.

2. Purpose

Query multi-hop relationships between entities using a graph-oriented data model.

3. How it works

  • Amazon Neptune is a managed graph database used when data has many relationships and connections between them need to be queried.
  • Neptune = Graph Database = Node + Relationship

Graph Model

  • Node/Vertex: An entity such as a person, account, or device.
  • Edge: A relationship between entities, such as friendship or shared device use.
  • Neptune: Suits queries traversing many relationships, such as finding connected account groups.
User A
↓ FRIEND_OF
User B
↓ BOUGHT
Product X
User
↓ LIKES
Post
↓ HAS_COMMENT
Comment

Neptune is strong when the question needs to go through many relationships.

Availability

  • AWS admin: Cluster · Replication · Backup · Failover
  • Read replicas can be used to scale reading workload.

Neptune Streams

  • Neptune Streams = records changes in the graph sequentially.
Graph changes
↓
Neptune Streams
↓
Consumer/Lambda
↓
OpenSearch / S3 / Cache
User A LIKE Product X
↓
Neptune Streams
↓
Lambda
↓
Update Recommendation Index

No need to poll the entire graph to find out what just changed.

4. Practical example

A fraud system finds accounts connected through shared devices, addresses, and payment methods.

User A
↓ friend
User B
↓ bought
Product X

Query: "What product did User A's friend buy?"

Neptune can traverse the graph directly instead of having to join multiple tables.

Social Network
↓
Friend / Like / Share relationships
Fraud Detection
↓
Account → Device → Transaction → Address
↓
Look for suspicious connections
Recommendation
↓
User → Product → Related Product
Knowledge Graph
↓
Entity → Relationship → Entity

5. Comparison

Graph databases prioritize relationship traversal; document databases organize documents; relational databases use tables and joins.

Neptune vs Other Databases

  • RDS / Aurora = relational SQL
  • DocumentDB = JSON document
  • Neptune = relationship / graph traversal
  • Timestream = data over time

Graph query language: SPARQL vs Gremlin/openCypher

Data model on NeptuneQuery language
RDF (Resource Description Framework) — triples & knowledge graphSPARQL
Property Graph — Vertices and edges carry attributesApache TinkerPop Gremlin or openCypher
Amazon Timestream

1. Concept

Timestream stores time-stamped data, such as sensor temperatures each minute, for analysis over time.

2. Purpose

Store and analyze timestamped measurements such as metrics and telemetry.

3. How it works

  • This topic describes Timestream for LiveAnalytics, closed to new customers since June 20, 2025 while supporting existing customers.
  • Timestream for InfluxDB is a separate option with a different deployment model.
  • Amazon Timestream is a serverless time-series database used to store and analyze timestamp data.
  • Timestream = Time Series Database = Timestamp + Measurements

Time Series Data

For example:

10:00 → CPU = 40%
10:01 → CPU = 55%
10:02 → CPU = 80%
  • Or IoT: Timestamp · DeviceId · Temperature · Humidity · Battery

Time is the most important part of data.

Data Model

  • A record usually has: Timestamp + Dimensions + Measures
  • Timestamp = 10:00 · Dimensions: · deviceId = sensor-01 · region = ap-southeast-1 · Measures: · temperature = 30 · humidity = 70

Multi-measure Record

If multiple measurements have the same timestamp:

  • 10:00 · Temperature = 30 · Humidity = 70 · Battery = 90%
  • Can be saved together: 1 Timestamp + many Measures
  • → reduce the number of records/writes.

Storage Tiering

Timestream divides the data itself:

Recent Data
↓
Memory Store
= query nhanh
Old Data
↓
Historical Storage
= cheaper
  • You can still query both.

Query

  • Timestream supports SQL for temporal analysis.
  • Average CPU per 5 minutes · Highest temperature today · Request latency in the last 1 hour
Time-series Data
↓
Timestream
↓
SQL / Aggregation
↓
Dashboard / Analytics

Scheduled Query

The query can be run periodically:

Raw CPU Metrics
↓
Scheduled Query
↓
Average CPU every 5 minutes
↓
Summary Table
  • Suitable for creating aggregates for dashboards.

Popular flow

IoT / Application
↓
Timestream Write API
↓
Recent Data
↓
Memory Store
↓
Historical Storage
↓
SQL / Dashboard

Timestream should not be used for

  • Customer · Order · Payment Transaction
  • If this is transactional business data, regular CRUD/relationship is needed.

Those cases are often more suitable for:

  • RDS / Aurora · DynamoDB

4. Practical example

Devices send temperature readings each minute; operations queries trends and hourly averages.

IoT Sensors
↓
Temperature / Battery / Location
↓
Timestream
Application Monitoring
↓
CPU / Latency / Error Count
↓
Timestream
Financial / Clickstream Events
↓
Time-window Analytics

5. Comparison

A time-series database optimizes timestamped measurements; a transactional database handles business updates such as orders.

Amazon Keyspaces (for Apache Cassandra)

1. Concept

Keyspaces is a Cassandra-compatible wide-column database whose underlying servers are managed by AWS.

2. Purpose

Run Cassandra-compatible workloads without managing cluster nodes and capacity.

3. How it works

  • Run an Apache Cassandra compatible wide-column database in fully serverless mode on AWS.

Architecture, Capacity & Integration Mode

AspectFeatures on Amazon Keyspaces
Platform architectureNoSQL managed, CQL-compatible serverless Apache Cassandra; automatically cloned via 3 Availability Zones with single-digit millisecond latency
On-Demand ModePay according to each actual read/write request, suitable for unpredictable load fluctuations
Provisioned Mode (+ Auto Scaling)Preset read/write capacity for stable load to optimize costs
Data Protection & CDCDefault encryption (AWS Owned Key or CMK), PITR Continuous recovery in 35 days and CDC Streams push record changes to Lambda, EventBridge, or Kinesis

4. Practical example

An application using Cassandra Query Language moves to Keyspaces to reduce node-management work.

5. Comparison

Keyspaces suits Cassandra applications; DynamoDB has its own APIs and access model.

Route 53 & Hybrid DNS

DNS & Amazon Route 53 fundamentals

1. Concept

Route 53 is a DNS service that helps applications find connection destinations from domain names such as example.com.

2. Purpose

Use easy-to-remember domain names instead of IPs and manage how DNS returns application endpoints.

3. How it works

How does DNS work?

  • DNS translates a name like api.example.com to an IP or destination name.
  • Resolver asks name servers when there is no cache; The authoritative name server is where the official answer for the zone is located.
Client → DNS resolver → Root → TLD (.com) → authoritative server
       ← IP is cached according to TTL
Client → connects directly to the application
  • Route 53: managed authoritative DNS, supporting domain registration and health-aware routing.
  • It returns a DNS answer, not a proxy web request.

TTL

  • TTL: How long a DNS answer may remain cached.
  • High TTL: Fewer DNS queries, but slower propagation of address changes to users.
  • Low TTL: Faster updates at the cost of more DNS queries.
  • A record: Includes its name, type, value/target, TTL where applicable, and routing policy.
  • Remember: DNS changes do not close existing connections or immediately clear every cache.

Public and Private Hosted Zones

  • Public zones serve public domain names on the Internet.
  • Private zone serving VPC is associated and hybrid network through appropriate Resolver; private names do not automatically open network access to the application.
  • To get private DNS working in VPC, enable the necessary DNS properties and check the association.
  • A hosted zone only contains records, not where the website is stored.

Registrar is different from DNS service

  • You can buy a domain from another registrar and then use Route 53: create a public hosted zone, update the name servers in the registrar according to the zone's NS.
  • It is not required to transfer domain ownership to AWS.

Route 53 A Alias Record Support Destination

  • Route 53 Alias Record Can be used right away zone apex (example.com — where not created CNAME) and freely point the query to two target groups: (1) AWS Resources is supported (ALB/NLB, CloudFront, API Gateway, S3 Website Endpoint, Global Accelerator, Elastic Beanstalk, VPC Interface Endpoint) and (2) another DNS Record of the same type in the same Hosted Zone.

4. Practical example

shop.example.com resolves to an ALB, while a database has an internal name in a private hosted zone.

Root domain pointing to ALB: Alias. Internal name for database/service: Private Hosted Zone. Public domain purchased outside of AWS: delegate DNS to Route 53.

5. Comparison

DNS answers where to connect; a load balancer distributes the resulting connections or requests.

Records need to be distinguished

RecordMeaning
AName → IPv4
AAAAName → IPv6
CNAMEName → other name; Do not use at zone apex
NSName server is responsible for zone/delegation
Alias of Route 53Point to a supporting AWS resource or appropriate record in the zone; Can be used at apex

For example example.com → ALB uses Alias; www.example.com can use CNAME.

Alias does not arbitrarily point to every hostname outside of AWS like CNAME and is not a direct way to point to EC2's IP using Alias.

Route 53 routing policies

1. Concept

A routing policy determines which destination Route 53 returns to a DNS query.

2. Purpose

Select endpoints returned in DNS by rollout rate, latency, location or health.

3. How it works

DNS Flow:

Client
↓ DNS query
Route 53 routing policy
↓ returns the appropriate endpoint
Client connects to endpoint

Simple

  • A record has one or more values; The client chooses when receiving multiple values.
  • Simple does not attach health checks directly to records; Alias ​​has Evaluate Target Health according to supported target types.
  • Suitable for a simple endpoint, no need for complex selection policies.

Weighted

  • Weight: Assigned to records sharing a name and type; weights need not total 100.
  • Example: Weights of 1 and 9 give roughly 10%/90% of DNS answers. Caching prevents exact request-level proportions.
  • Weight zero: Normally excluded while healthy positive-weight records exist; may be considered if those records are unhealthy.
  • All zero: Answers are shared equally. Zero weight is not an access-blocking mechanism.

Latency-based

  • Choose the Region with the best measured latency for the query side, not necessarily the closest by geographical distance.
  • Suitable for apps running multiple regions that need quick response, can combine health to eliminate error endpoints.

Failover

  • Active-passive: if primary is healthy, return primary; If primary fails, switch to secondary according to configured health.
  • Suitable for DR site or backup notification site.

Geolocation

  • Select by queryer's location: continent, country or US state.
  • More specific regions are preferred; create default record for unmatched location.
  • Content/language matching by country.
  • DNS routing is not a mechanism to prevent unauthorized access; want to enforce permissions/areas that need to be controlled in the application/edge.

Geoproximity

  • Choose according to the distance between user and resource, with bias to expand/retract service area.
  • Positive bias increases resource traffic, negative bias decreases.
  • Other geolocation is divided by national borders and latency is selected by latency.

IP-based

  • Use CIDR collection to map the query source/client address provided by DNS to the location/endpoint.
  • Suitable when you know the company's/ISP's IP range and want your own route;
  • The DNS resolver and EDNS client subnet can affect the addresses Route 53 sees.

Multi-Value Answer

  • Return up to 8 healthy records per query when configuring health check.
  • The client connects itself to a value; There is no connection management proxy like ELB.

4. Practical example

A team uses weighted routing to test a new version with a portion of traffic before increasing its share.

Canary about 10%: Weighted. Global app prioritizes latency: Latency-based. By language/country: Geolocation. Change service area by bias: Geoproximity. Primary/backup: Failover.

5. Comparison

Weighted uses weights; latency routing prioritizes latency; geolocation uses location; failover chooses primary or backup.

Route 53 health checks & failover

1. Concept

Health checks test destination health so Route 53 can select an appropriate DNS answer under its routing policy.

2. Purpose

Use health checks to select healthy endpoints and switch to a backup location when a failure occurs.

3. How it works

Three ways to determine health

WayWhen used
Endpoint health checkPublic HTTP/HTTPS/TCP endpoint
Calculated health checkCombine the results of multiple health check children
CloudWatch alarm health checkMetric/alarm signal, useful for private resources
Route 53 health checker on the Internet does not go directly to the internal private IP
VPC.
With private apps, you can use monitoring inside VPC → metric/alarm → health
check.

Evaluate Target Health

  • Alias to supported resources such as ELBs can obtain the target's health using Evaluate Target Health, without creating a separate Route 53 endpoint check.
  • Not all alias targets support this; CloudFront does not support Evaluate Target Health = Yes.
  • Check the health of a specific endpoint, avoid checking the domain itself that is failing over because the results will depend on its DNS routing. AWS health-check configuration.

Active-passive failover

Primary healthy → DNS returns primary
Primary unhealthy → DNS returns secondary according to configured health
  • Primary needs appropriate health signal: health check or Evaluate Target Health with Alias support.
  • Secondary must be truly ready to serve and have data/capacity that meets DR.

DNS has cache

  • Failover DNS only changes the answer for the next query; Do not transfer current connection open.
  • TTL, error detection time, and client retry all affect interruption time paragraph.
  • If all endpoints are unhealthy, Route 53 has fail-open behavior depending on the policy; Do not consider health check as a firewall that always blocks all faulty endpoints.

4. Practical example

When the primary Region's application fails, DNS directs users to a prepared application in another Region.

Active-passive between two Regions; primary ALB and static recovery page; Calculated checks reflect multiple dependencies. Try actual DR, checking both DNS and database and application status.

5. Comparison

DNS failover changes DNS answers; database failover changes database processing; each needs its own design.

Hybrid DNS & Route 53 Resolver

1. Concept

Route 53 Resolver enables private DNS resolution between VPCs and corporate networks.

2. Purpose

For AWS and on-premises to resolve each other's private domain names.

3. How it works

Resolver in VPC

  • Route 53 Resolver handles AWS-provided names, public DNS and associated Private Hosted Zone.
  • VPN/Direct Connect connection creates a network connection but does not automatically make all private DNS on both sides understand each other.

Inbound endpoint

  • Inbound: query direction going into AWS: DNS on-prem forward domain AWS/private zone to the IP of the inbound endpoint.
On-prem machine → DNS on-prem → VPN/DX → Inbound endpoint → Private Hosted Zone
  • There is no need to turn private records into public for internal users to look up.

Outbound endpoint

  • Outbound: Query direction going out of AWS: Resolver forwarding rule selects suffix like corp.example.com and then sends query through outbound endpoint to DNS on-prem.
EC2 → VPC Resolver → rule for corp.example.com → Outbound → DNS on-prem
  • The rule must be associated with the VPC in use; can share cross-account rules via AWS RAM.

Availability and network

  • Use IP endpoints in at least two AZs, SGs for DNS TCP/UDP 53 and VPN/DX lines to the DNS server.
  • Check route/firewall both ways.
  • Do not forward the same domain around to both sides and then back to yourself.
  • Resolvable DNS still needs route/SG to connect to the return IP.

Three types of Resolver Rule: Forward Rule, System Rule & Delegation Rule

Ingredients / RulesDistinguishing function
Inbound EndpointReceive DNS queries from On-premises going into VPC Resolver (Private Hosted Zone resolution)
Outbound Endpoint + Forward RulePass the DNS query of the specified domain (eg corp.example.com) from VPC to DNS Server On-premises IP
System RuleKeep a specific subdomain (eg aws.corp.example.com) back to AWS VPC Resolver to process, causing an exception to override the parent Forward Rule
Delegation RuleAuthorize subdomain resolution based on records NS to the authoritative DNS server via Outbound Endpoint

4. Practical example

Office servers resolve a private AWS database name through a Resolver inbound endpoint.

On-prem look up the private database name in AWS: Inbound. EC2 looks up Active Directory domain on-prem: Outbound + forwarding rule. Multiple accounts share the same hybrid DNS: share rules.

5. Comparison

Inbound endpoints receive DNS queries into AWS; outbound endpoints forward VPC queries to external DNS using rules.

Amazon S3

Amazon S3 fundamentals, buckets & websites

1. Concept

S3 stores files as objects in buckets; each object has a key used to locate and access it.

2. Purpose

Store and distribute files, backups, logs, and lake data at scale without managing disks.

3. How it works

  • Amazon S3 is an object storage service for storing files, backups, logs, data lakes and static content with very high durability and scalability.
  • S3 = Object Storage = File / Backup / Log / Data Lake

Bucket & Object

S3 saves data according to:

Bucket
↓
Object
  • Objects include: Key · Value (data/file) · Metadata

For example:

  • Bucket: company-data · images/logo.png · logs/2026/app.log · reports/report.pdf
  • images/ good logs/ just prefix logic, not the real filesystem folder.

Bucket = container, Object = file/data, Key = name/path of object.

Bucket & Region

  • Bucket is created in an AWS Region.
S3 Bucket
↓
ap-southeast-1
  • Bucket names according to the S3 namespace must normally be unique.
  • Some important rules: 3–63 characters · lowercase · no underscore _ · not the same as IP address

S3 looks like a global service, but bucket's data is in the selected Region.

Object Size

  • Object: A file and its metadata stored in S3; each object can be up to 50 TB.
  • Multipart Upload: Splits a large file into parts for parallel uploads; S3 assembles the parts into one object.
Large File
↓
divided into many parts
↓
parallel upload
↓
S3 reassembled

Consistency

  • S3 provided strong consistency for: PUT · DELETE · LIST
Upload objects
↓
GET/LIST immediately after
↓
see new version

S3 is not a File System

  • S3 is not: EBS = block storage · EFS = file system
  • The application accesses S3 via: API · SDK · HTTP · AWS CLI

Static Website Hosting

  • S3 can host: HTML · CSS · JavaScript · Images

But S3 website endpoint mainly uses:

HTTP

Production is usually better:

User
↓ HTTPS
CloudFront
↓
Private S3 Bucket
  • with: OAC = Origin Access Control
  • → S3 does not need to be published directly.

S3 Security

  • There are two common classes of permissions: IAM Policy = What can principal do?
  • Bucket Policy = who can access bucket/object
IAM User
↓
IAM Allow s3:GetObject
↓
S3

or cross-account:

Account A
↓
Bucket Policy
↓
Bucket Account B
  • Principle: Explicit Deny · > all Allows

Block Public Access

  • This is a guardrail against accidentally publicizing a bucket/object.
  • Block Public Access = block public access
  • If you want to static public website directly using S3, you must configure public access accordingly.
  • Production often prioritizes: Private S3 + CloudFront

Object Ownership & ACL

  • Modern S3 often uses: Bucket Owner Enforced
  • → ACL is disabled.
  • Main rights are governed by: IAM Policy · Bucket Policy · Access Point Policy

Prioritize policies instead of ACLs.

Pre-Signed URL

  • Used to give users access temporary private object.

Download:

Backend
↓
Generate Pre-Signed URL
↓
User
↓
GET private object

Upload:

Backend
↓
Pre-Signed PUT URL
↓
Browser
↓
Upload directly to S3
  • Object still: Private ✅
  • The URL is only valid for the specified time.

Pre-signed URL ≠ public bucket.

S3 Access Points

  • Access Point creates separate endpoint + policy for each application/team.
An S3 Bucket
├── /finance/*
├── /sales/*
└── /analytics/*

Can create:

Finance Access Point
→ /finance/*

Sales Access Point
→ /sales/*

Analytics Access Point
→ read necessary data
  • → avoid a policy bucket that is too large.

VPC Access Point

You can limit access only from VPC:

EC2 in VPC
↓
S3 VPC Endpoint
↓
VPC-only Access Point
↓
S3
  • Suitable when you want: S3 access · does not go to the Internet

S3 Object Lambda

  • Allowed transform object at GET without modifying the original object.
Application
↓
Object Lambda Access Point
↓
Lambda
↓
Transform
↓
Response
Redact PII
Resize image
Add watermark
XML → JSON
  • Original Object: no change

4. Practical example

A website stores product images in S3 and delivers them through CloudFront.

Backup / Archive · Logs · Data Lake · Images / Videos · Static Assets · Software Distribution · Disaster Recovery

Commonly used long-term archives: S3 Glacier storage classes

5. Comparison

S3 is object storage; EBS provides block disks; EFS provides a shared filesystem.

S3 encryption, HTTPS & CORS

1. Concept

Encryption protects data, HTTPS protects it in transit, and CORS controls whether a different website can read a response in the browser.

2. Purpose

Protect content stored in S3, encrypt transmission and let the browser access the correct origin.

3. How it works

Encryption at rest

WayWho manages the key?Point to understand
SSE-S3S3/AWSAES-256 server-side encryption; default for new objects
SSE-KMSAWS KMSControl key policy, audit key usage, have KMS permission/quota/cost
SSE-CCustomersSend key per request over HTTPS; S3 does not save keys for future use
Client-sideApplication/clientEncrypt before upload; S3 only receives ciphertext
  • Encryption does not grant access on its own and does not change bucket policy.
  • Changing the default encryption does not automatically re-encrypt any old objects with the new type/key.

SSE-KMS

  • Upload needs appropriate permissions like kms:GenerateDataKey; reading requires kms:Decrypt.
  • Cross-account access requires S3 permission and customer managed KMS key permission from the other side.
  • KMS's request rate may become limited when S3 traffic is large.
  • S3 Bucket Keys help reduce KMS requests and SSE-KMS costs when appropriate; must still keep the correct key policy.

HTTPS

  • TLS/HTTPS protects transmission. Bucket policy can be explicit Deny if aws:SecureTransport=false to deny HTTP.
Client --HTTPS--> S3 --server-side encryption--> object is saved
  • S3 website endpoint does not support HTTPS directly; Use CloudFront for your website HTTPS. SSE-C requires HTTPS and must keep the key secure. If the key is lost, it cannot be decrypted.

CORS

  • Origin includes protocol, host and port.
  • The web at https://app.example.com calling S3 at another origin needs CORS on the destination bucket with the appropriate origin/method/header.
  • CORS is a browser rule for reading responses, does not grant S3 permissions and does not prevent any clients outside the browser.
  • Pre-signed URL/bucket policy must still allow action first.

4. Practical example

A browser uploads images over HTTPS using presigned URLs and CORS allowing the website's domain.

Need control/audit key: SSE-KMS. Browser uploads directly to S3: pre-signed PUT + CORS. Data must be encrypted before reaching S3: client-side. Only for secure transmission: policy enforces HTTPS.

5. Comparison

CORS does not grant S3 permission; IAM and bucket policies do; SSE-KMS also requires KMS key permissions.

S3 versioning, replication & immutable protection

1. Concept

Versioning keeps older versions, replication copies objects, and Object Lock enforces configured retention against unauthorized deletion or changes.

2. Purpose

Recover an overwritten/wrongly deleted object that has a copy elsewhere and keep the data from being destroyed prematurely.

3. How it works

Three different mechanisms:

  • Versioning = keeping versions
  • Replication = copy to another bucket
  • Object Lock = version protection by retention

Versioning

  • Versioning: Keeps several versions of the same file in a bucket. Overwriting the file creates a new version.
  • Normal deletion: S3 adds a delete marker; older versions remain available for recovery.
  • Recovery: Retrieve an older version or remove the appropriate delete marker to make the file visible again.
  • Permanent deletion: Deleting a specific version ID removes that version. Suspending versioning does not remove existing versions.

CRR and SRR

  • CRR replicate to another Region; SRR replicates in the same Region.
  • Can cross-account, needs Versioning at source/destination with appropriate roles and policies; The SSE-KMS object also needs KMS configuration/permissions.
  • Asynchronous replication: does not promise data to appear immediately.
  • By default, the live replication rule applies new objects after enabling it; old object used S3 Batch Replication.

Delete and replicate

  • Delete markers can be replicated if appropriate options and rules are enabled.
  • Permanently deleting a version at the source does not automatically replicate that deletion to the destination.
There is no automatic chaining: object replicate A → B does not continue on its own to B → C
just because B has a rule to C.
If you want multiple destinations, configure appropriate replication from the source.

MFA Delete

  • MFA required when permanently deleting version or changing Versioning status.
  • MFA is not required just to add a regular delete marker.
  • Bucket owner/root enables or disables MFA Delete via API/CLI with MFA, not via S3 Console. Versioning must be enabled.

Object Lock

  • WORM protects each version; Need Versioning.
  • Can be enabled for new or existing buckets according to the support process; Once enabled, do not turn off Object Lock/Versioning in the usual way.
MechanismMeaning
Governance retentionPeople with appropriate bypass permissions can bypass protection
Compliance retentionNo one, not even root, can remove/shorten the retention of the locked version
Legal holdHold until the person with the right to remove the hold; independent of retention date
  • Locking an existing version still allows writing a new version with the same key.
  • Legal hold does not expire; Expired retention may not be deleted if legal hold is still on.

4. Practical example

A company retains records with Object Lock and replicates them to a backup Region.

File is overwritten: Versioning. DR/compliance multiple Region: CRR. Anti-ransomware backups or records should remain intact: Object Lock, limited permissions and appropriate policy retention.

5. Comparison

Replication does not replace point-in-time backups; versioning alone does not prevent authorized permanent deletion.

S3 storage classes & lifecycle

1. Concept

Storage classes match storage to access needs; lifecycle rules automatically transition or delete objects.

2. Purpose

Choose the appropriate storage class to optimize costs based on:

3. How it works

  • Access frequency · Retrieval time · AZ number · Retention time · Ability to reproduce data

Overview of Storage Classes

  • S3 Standard = frequent visits
  • Standard-IA = less access = multi-AZ
  • One Zone-IA = low traffic = 1 AZ
  • Intelligent-Tiering = AWS automatically changes tiers according to access patterns
  • Glacier = archive / long-term storage
  • Express One Zone = 1 AZ = very low latency / high performance
  • Common points: Durability = 99.999999999% (11 nines)
  • Main differences: Availability · AZ · Storage cost · Retrieval cost · Retrieval time · Minimum storage duration

S3 Standard

  • S3 Standard = general purpose = frequent access = multi-AZ = low latency = high throughput
  • No: Retrieval fee · Minimum storage duration
  • Suitable: Active application data · Web content · Big Data · Mobile / Gaming

Standard-IA

  • IA = Infrequent Access

Used for data:

Less access
but when needed
→ must get it immediately
  • Standard-IA = multi-AZ = fast retrieval = cheaper storage Standard = has a retrieval fee
  • According to the slides: Minimum storage duration = 30 days

Use cases:

  • Backups · Disaster Recovery · Data is rarely accessed

One Zone-IA

  • One Zone-IA = same as IA but only stored in 1 AZ

Therefore:

Cheaper than Standard-IA
but
AZ is lost
→ data may be lost
  • Suitable when data: Can be recreated · or · already has another copy

For example:

  • Thumbnails · Secondary backup · Re-creatable data

Test score: need infrequent access + data can recreate → think about One Zone-IA.

S3 Intelligent-Tiering

  • Use when: Unknown · access pattern
  • AWS automatically tracks access and transfers objects between tiers.
Frequent Access
↓ no access for 30 days
Infrequent Access
↓ No longer access
Archive Instant Access
  • There are additional optional archive tiers: Archive Access · Deep Archive Access
  • Advantages: Automatically optimize storage cost · No need to manually write transitions according to access pattern · No retrieval fee between access tiers
  • Yes: Monitoring / automation fee

Test score: access pattern is unstable or unpredictable → Intelligent-Tiering.

S3 Glacier Classes

  • Used for: Archive · Backup · Long-term retention
1. Glacier Instant Retrieval
  • Retrieval = milliseconds
  • Archive is rarely accessed · but when needed, get it immediately
  • Minimum storage = 90 days
2. Glacier Flexible Retrieval
  • Retrieval can choose: Expedited = 1–5 minutes
  • Standard = 3–5 hours
  • Bulk = 5–12 hours
  • Archive is appropriate when: No need to get it right away
3. Glacier Deep Archive
  • Cheapest + retrieval is the slowest
  • Standard ≈ 12 hours
  • Bulk ≈ 48 hours
  • Minimum storage = 180 days
  • Compliance archive · Long-term backup · Data for many years is rarely accessed

Glacier storage classes

Instant
= milliseconds

Flexible
= minutes → hours

Deep Archive
= many hours
= cheapest
  • Minimum storage according to slide: Instant = 90 days
  • Flexible = 90 days
  • Deep Archive = 180 days

S3 Express One Zone

  • Express One Zone = high-performance storage class = single AZ
  • Object is saved in: Directory Bucket
  • Characteristics: Very low Latency · High request throughput · Compute + storage can colocate in the same AZ
  • AI / ML · HPC · Financial modeling · Media processing · Latency-sensitive workloads
  • Points to remember: Express One Zone = performance
  • One Zone-IA = save costs for rarely accessed data
  • Both are: Single AZ; but use cases are different.

S3 Lifecycle Rules

S3 Lifecycle and Amazon DLM
MechanismWhat data management?Function
S3 Lifecycle RulesS3 objects / object versionsTransition storage class, expiration and cleaning multipart uploads according to rules
Amazon Data Lifecycle Manager (DLM)EBS snapshots / EBS-backed AMIsAutomatically create, retain and delete scheduled backups; See EBS snapshots section
  • DLM manages EBS backups, not the lifecycle of S3 objects, even though EBS snapshots are stored by AWS in S3 on the service side.
  • Automatic Lifecycle Rules: Transition = change Storage Class
  • Expiration = delete object
S3 Standard
↓ 60 days
Standard-IA
↓ 180 days
Glacier
↓ 365 days
Delete
  • → optimize costs without manual operations.

Transition Actions

  • Used to transfer objects to another storage class.
New Object
↓
Standard

after 30 days
↓
Standard-IA

after 180 days
↓
Glacier
  • Can apply to: Current Version · Noncurrent Version

Not all storage classes arbitrarily transition to each other; must comply with S3's Lifecycle transition rules.

Expiration Actions

  • Lifecycle can self-delete: Current object · Old object versions · Delete markers · Incomplete multipart uploads
Access Logs
↓
365 days
↓
Delete

Or:

Multipart Upload is bad
↓
7 days
↓
Abort
  • → Avoid paying for data that is no longer needed.

Lifecycle Filter

Rules can be applied only to a group of objects by:

  • Prefix · Tags
  • Prefix · logs/; or: Tag · Department = Finance

Minimum Storage Duration

  • Points that are easy to trap in the exam: Storage class is cheaper ≠ is always cheaper
Object
↓
Standard-IA
↓
delete after 5 days
  • Standard-IA · minimum storage = 30 days
  • → Minimum duration may still be charged.
  • Similar: Glacier = retrieval fee + minimum storage duration
  • Should consider: Storage cost + Retrieval cost + Minimum duration

Lifecycle Scenario

Profile Image
├─ Original
└─ Thumbnail

Thumbnail:

Can be recreated
↓
One Zone-IA
↓
Expires after 60 days

Original photo:

The first 60 days require immediate access
↓
Standard

after 60 days
↓
Glacier Flexible Retrieval
  • because users accept to wait a few hours when retrieving.

S3 Storage Class Analysis

Storage Class Analysis helps:

Analyze access patterns
↓
Suggest a suitable time
↓
Standard → Standard-IA
  • → support Lifecycle Rule design.
  • Standard · Standard-IA
  • Analysis is not supported for: One Zone-IA · Glacier

Report:

CSV
↓
update daily
  • 24–48 hours · to start getting data

Test score: want to analyze when to switch Standard → Standard-IA → S3 Storage Class Analysis.

Glacier Expedited Retrieval & Provisioned Capacity Details

Glacier Flexible Recovery CaseTime specification & capacity guarantee
Expedited (< 250 MB)Usually completed in 1–5 minutes when capacity is available
Large objects (from 250 MB to many GB)Don't guarantee completion in 5 minutes even if Expedited is selected
Provisioned CapacityBuy in advance to ensure Expedited retrievals are immediately available for sensitive emergency loads

4. Practical example

Frequently viewed images start in Standard and transition to an appropriate class as access declines.

Active / frequent data
↓
Standard
Less access + need to retrieve immediately
↓
Standard-IA
Less access + can recreate
↓
One Zone-IA
Don't know the access pattern
↓
Intelligent-Tiering
Archive but need to retrieve immediately
↓
Glacier Instant
Archive accepts waiting
↓
Glacier Flexible
Archived for many years / cheapest
↓
Deep Archive
Single-AZ + extremely low latency
↓
Express One Zone

5. Comparison

Compare access frequency, retrieval time, AZ coverage, and minimum duration rather than storage price alone.

Quick comparison

Storage ClassAccessAZRetrievalMin Storage according to the slide
StandardFrequentMulti-AZImmediateNo
Standard-IAInfrequentMulti-AZImmediate30 days
One Zone-IAInfrequent1 AZImmediate30 days
Intelligent-TieringDon't know the patternMulti-AZAccording to tierDepends on tier
Glacier InstantArchiveMulti-AZMilliseconds90 days
Glacier FlexibleArchiveMulti-AZMinutes → hours90 days
Deep ArchiveLong-term archiveMulti-AZNow180 days
Express One ZonePerformance1 AZVery low—
S3 events & service integrations

1. Concept

S3 sends notifications about object changes, such as triggering thumbnail creation after an image upload.

2. Purpose

Automatically handle new or changed objects, instead of constantly checking the bucket.

3. How it works

Event stream

Upload object → S3 event → SQS / SNS / Lambda / EventBridge
                           └─ processor reads object from bucket
  • Event describes the bucket/key/version and operation, not the entire file content.
  • Prefix/suffix can be filtered to only process uploads/ or .jpg.

Select destination

  • SQS serves as a buffer for workers; SNS fan-out; Lambda processing directly; EventBridge has rules/filters and many target types.
  • The direct SQS/SNS/Lambda destination must be in the same Region as the bucket according to the supported configuration.
  • S3 does not send directly to the SQS FIFO; Use EventBridge if you need a FIFO target. AWS notification destinations.

Where is Permission located?

  • Notification permission: The SQS, SNS, or Lambda resource policy must allow the S3 service (s3.amazonaws.com) to send notifications to it.
  • Source restriction: Allow only the required bucket ARN and AWS account. A destination encrypted with KMS also needs key permissions.
  • File access: The consumer needs permission to read the object and decrypt it if necessary. Permission to receive events does not grant file access.
  • Relevant APIs: SQS uses sqs:SendMessage; SNS uses sns:Publish; Lambda uses lambda:InvokeFunction.

Duplicate events and loops

  • Events can repeat: A notification may arrive more than once, and there is no global event order.
  • Avoid duplicate effects: Processing the same object/version again must not repeat the business action, such as sending two emails for one upload.
  • Avoid loops: Separate input and output prefixes or buckets. A thumbnail Lambda should not write back into the location that triggers itself.

4. Practical example

A new bucket image produces an SQS message; workers generate thumbnails and handle retries.

Upload photo → thumbnail. New file → SQS → worker processing with retry. Event by object type → EventBridge → Step Functions for multiple steps.

5. Comparison

Event notifications trigger processing; replication copies data; inventory periodically lists objects.

S3 performance, Requester Pays & Batch Operations

1. Concept

S3 supports faster transfers, operations across many objects, and requester-paid access charges.

2. Purpose

Speed up file transfers, manipulate multiple objects, and choose which side pays the cost of reading data.

3. How it works

Tools according to your needs:

  • Multipart Upload = split file into multiple parts
  • Byte-range GET = read part of object
  • Transfer Acceleration = transfer acceleration across the edge
  • Batch Operations = process multiple objects
  • Requester Pays = requester pays request/data transfer fee

Request rate by prefix

  • S3 supports at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD per second per partitioned prefix.
  • Distributing workload across multiple prefixes helps increase total throughput; When scaling quickly, you may encounter 503 Slow Down and need to retry/backoff.
  • Prefix: the beginning of the object key, not the physical folder.
  • With SSE-KMS, the KMS request quota must also be considered.

Multipart Upload

  • Split object into parts to upload in parallel; If the part is defective, just send that part back.
  • Usually worth using from about 100 MB, required when exceeding the 5 GB single PUT limit.
  • The maximum object is now 50 TB via multipart, instead of 5 TB in the old document.
  • Configure lifecycle cleaning incomplete multipart upload to avoid unfinished part fees. AWS object upload limits.

Transfer Acceleration and byte-range GET

  • Transfer Acceleration receives data at the edge location and then uses the AWS network to reach the bucket, allowing uploading from remote locations via the Internet; must turn on the bucket and measure the benefits versus costs.
  • Multipart combinations are possible.
  • Byte-range GET takes part of an object or multiple ranges in parallel, reading header/file chunks and speeding up download; error just retry the corresponding part.

Batch Operations

  • A job includes a manifest object, action, and IAM role.
  • Used to copy, change tags, restore archive or invoke Lambda on many objects; service tracks and generates completion reports.
  • Use Inventory/Athena to select objects into the manifest when appropriate.
  • Changing the old encryption object usually requires copy/rewrite, not just changing the default encryption in the bucket.

Requester Pays

  • Authenticated requesters pay request and download fees; The bucket owner still pays for storage.
  • Requester must confirm payment; anonymous access is not supported.
  • This is a fee mechanism and does not grant permission to read the bucket. Still need policy to allow requests.

Parallel download using S3 Byte-Range Fetches

S3 Large Object
  ├─ HTTP Range: bytes=0-99MB → Worker 1
  ├─ HTTP Range: bytes=100-199MB → Worker 2
  └─ HTTP Range: bytes=200-299MB → Worker 3
  ↓ Merge order at client → Increase download throughput & retry only error parts

4. Practical example

A team retags millions of objects with Batch Operations instead of scripting individual updates.

Large video: multipart. Upload from multiple continents: try Transfer Acceleration. Retag millions of objects: Batch Operations. Divide large dataset to another account: Requester Pays.

5. Comparison

Multipart divides uploads; byte-range GET divides downloads; Batch Operations processes lists of objects.

S3 logging, Storage Lens & analytics

1. Concept

S3 logs and reports show access activity, storage usage, and optimization opportunities.

2. Purpose

Know who is accessing it, how much data is being used and where costs can be reduced or protection increased.

3. How it works

Choose tools according to the question:

  • Server Access Logging = request to bucket
  • CloudTrail data events = object-level API activity
  • Storage Lens = usage statistics / configuration
  • Storage Class Analysis = suggested lifecycle

Choose tools according to the question

ToolsAnswer the question
Server Access LoggingHow does request to bucket happen?
CloudTrail data eventsWho calls the API at the object level and what action is called?
Storage LensHow is usage, activity and overall protection configuration?
S3 Inventory

List of objects/versions and metadata for analysis or batch
  • CloudTrail management events do not replace object data events; You need to enable the appropriate data event type to audit object operations and consider costs.

Server Access Logging

S3 Server Access Logging: Record access requests to S3 bucket.

Flow:

User / App sends request to S3
↓
S3 creates access logs
↓
Send logs to Logging Bucket / Prefix

Storage Lens

  • S3 Storage Lens = dashboard helps Overview and analysis of S3 usage.

Can be viewed by:

Organization
↓
Account
↓
Region
↓
Bucket
↓
Prefix

Help to know:

  • How much data is being saved?
  • Which Storage Class are you using?
  • versioning / replication ra sao
  • Which bucket is most active?
  • Where can storage/cost be optimized?

For example:

Multiple S3 Buckets
↓
S3 Storage Lens
↓
General dashboard
↓
Find optimal opportunities
  • Free Metrics = basic information.
  • Advanced Metrics & Recommendations = more detailed analysis + recommendations, additional fees apply.

S3 Inventory

= create list of objects in S3 bucket according to schedule.

For example:

S3 Buckets
↓
S3 Inventory
↓
List of objects
- keys
- size
- storage class
- encryption
- version...

This list can be used to Select the object for S3 Batch Operations.

Flow:

S3 Inventory
↓
List of objects to be processed
↓
S3 Batch Operations
↓
Batch execution

For example Batch Operations can:

  • copy multiple objects
  • restore object from Glacier
  • change tags
  • invoke Lambda on multiple objects

Remember: S3 Inventory = make a list of objects, also S3 Batch Operations = run batch actions on that list.

4. Practical example

After a file is deleted, the security team uses CloudTrail data events to identify the API caller.

Investigate who read/deleted files: CloudTrail data events. Analyze access log: Server Access Logging + Athena. Check costs/protect multiple buckets: Storage Lens. Select batch object: Inventory.

5. Comparison

CloudTrail audits APIs; access logs record requests; Storage Lens aggregates storage metrics; Inventory lists objects.

S3 access control, sharing & access points

1. Concept

S3 uses policies and access controls to protect files and can share private objects within authorized permissions and time limits.

2. Purpose

Grant permissions to the correct bucket/object and share private files without opening all data publicly.

3. How it works

Permission check flow:

Client request
↓ IAM / bucket / access point policies
S3
↓ allowed
Object

IAM policy, bucket policy and ACL

  • IAM policy grants permissions to users/roles; bucket policy grants permissions from the resource side, useful for cross-account or AWS services.
  • Explicit Deny still beats Allow; SSE-KMS adds a key permission layer.
  • Bucket ARN is used for bucket level actions like ListBucket; object ARN is used for GetObject/PutObject. Do not confuse arn:aws:s3:::bucket with arn:aws:s3:::bucket/*.
S3 ACL — permissions on bucket or object
  • S3 ACL (Access Control List) grant basic permissions to AWS accounts or supported groups on buckets or individual objects; Does not have the same level of detail/conditions as IAM and bucket policies.
TypeScope and examples
Bucket ACLPermissions at the bucket level: READ allows listing objects; Do not allow yourself to read the content of every object.
Object ACLPermissions on each object: READ to read file; READ_ACP/WRITE_ACP to read/edit ACLs.
  • READ = list bucket or read object, depending on ACL type
  • WRITE = create/delete object at bucket level; Does not apply to Object ACLs
  • READ_ACP = read ACL
  • WRITE_ACP = edit ACL
  • FULL_CONTROL = full ACL permissions applicable to that resource
  • For example: Account A owns report.pdf and grant read permission to Account B via Object ACL when ACL is on.
AWS Account A
└── S3 Bucket
    ├── Bucket ACL → bucket grant permission
    └── report.pdf
        └── Object ACL → Account B: READ
  • ACL issued to account B through canonical user ID; B needs to allow his IAM principal to use the granted permissions. Explicit Deny and KMS permissions (if any) are still checked.
  • The new bucket defaults to using Object Ownership = Bucket ownership effective: ACL is disabled, permissions are managed by policy. Usually keep this default and use bucket/IAM policy for cross-account.
  • Block Public Access = guardrail prevents unwanted public opening; A public Allow is not necessarily effective force if guardrail blocks.

Pre-signed URL

  • The backend signs the URL for an action/key for a limited time.
  • The person with the URL uses signer rights for that request, without needing to receive an access key;
  • The URL is a bearer token so it must be kept private.
  • The URL does not override the signer's authority and may expire early when the temporary credential expires.
  • With SigV4 and IAM User credential, the maximum period is usually 7 days; Don't consider every URL to live 7 days.
  • Pre-signed URLs are not disposable by default. Upload browser needs proper CORS in addition to PutObject permission.

Access Points

  • Each Access Point has its own hostname and policy for the application/team, pointing to the same a bucket.
  • Bucket policy and access point policy must coordinate; Access Points are not bypassed bucket guardrail.
  • VPC-only Access Point limits access through the specified VPC, combining VPC Endpoint and endpoint policy.
  • Having a route to S3 still requires full IAM/bucket/access point/KMS permissions.
Multi-Region Access Point (MRAP)
  • MRAP provides a global endpoint for S3 buckets in many Regions. The request itself goes through the AWS network to the bucket with the lowest network latency among the available buckets active routing status; Integrated automatic MRAP AWS Global Accelerator.
  • Global users | v MRAP Global Endpoint | +-------+-------+ | | etc S3 Bucket A S3 Bucket B US Region Singapore | | +----- CRR -----+ Copy data
  • MRAP routes requests; CRR copies data. Cross-Region Replication must be configured separately between buckets; If receiving records in both Regions, two-way replication configuration is appropriate. CRR is asynchronous, so data does not appear immediately in the other bucket.
  • MRAP does not select a bucket based on whether the object exists or not: GET can return 404 If the selected bucket does not have an object. For example, US and Singapore users use the same endpoint to read replicated data in two Regions. ·

S3 Object Lambda

  • Object Lambda uses Lambda to change the content when passing through the Object Lambda Access Point, for example hiding PII or changing format; The original object is not modified.
  • From November 7, 2025, the feature is only available to existing customers and certain qualified partners.
  • Keep conceptual to understand old SAA documents; when the new design can be processed via Lambda/API Gateway/CloudFront or before saving. AWS availability change.

S3 ACL Details & Maximum Presigned URL Term

S3 decentralization mechanismScope & Limitations to remember
Bucket owner effective (Default)The new bucket completely disables ACLs by default; Only re-enable ACLs when you really need to authorize individual objects
Bucket ACL vs Object ACLBucket ACL control list/write permissions at bucket level; Object ACL Grants permission to read each individual object (no permission to edit object content via Object ACL)
S3 Presigned URL (SigV4)Creation via SDK/CLI has a maximum duration 7 days (or shorter if signed with STS temporary credentials about to expire)

4. Practical example

A customer receives an expiring presigned GET URL for a private invoice while the bucket stays private.

Download temporary private file: pre-signed GET. Browser uploads directly: pre-signed PUT. Data lake with multiple teams: Access Points and policy by prefix. Cross-account: Allows both the IAM side and the appropriate resource/key.

5. Comparison

  • A presigned URL temporarily shares the signer's permissions;
  • an Access Point has its own policy;
  • OAC secures CloudFront-to-S3 access.

CloudFront & Global Accelerator

Amazon CloudFront: CDN & origins

1. Concept

CloudFront caches content near users for faster delivery and less work at the origin.

2. Purpose

Deliver web/files via edge near users to reduce latency and backend load.

3. How it works

Cache at the edge

Viewer → edge location
          ├─ cache hit → return content
          └─ cache miss → origin → cache when policy allows → return content
  • Origin: The place holding the original content, such as S3 or a web server.
  • Edge location: A serving location near users. CloudFront returns a suitable cached copy immediately, or fetches it from the origin on a cache miss.
  • Distribution and cache behavior: The distribution holds delivery settings; a behavior selects the origin and caching rules for a URL path.
  • Content types: CloudFront delivers both static files and dynamic content over HTTP(S). Uncached requests can still benefit from optimized connections.
  • Origin location: An origin can be in AWS or on premises and need not share an AZ with CloudFront. VPC origins require supported Regions and resources.

Origins

Origin / mechanismFunctionFor example
S3 OriginGet content from S3 bucketHTML, CSS, JS, images
Custom OriginGet content from HTTP/HTTPS serverPublic ALB, EC2, web server on-premises
VPC OriginPrivate connections to VPC resources are supportedInternal ALB, NLB, EC2
Origin GroupPrimary + secondary origins group for failoverPrimary ALB fails → Secondary S3 serves the backup site
  • Origin Group is a backup group, not a type of server. Failover according to configured connection error/status codes, GET/HEAD/OPTIONS only; OPTIONS must also be enabled in cached HTTP methods. Do not use this mechanism to failover POST yourself.
  • VPC origin helps origin to be private, but must still meet SG/network requirements and supported features.
  • Public custom origins need to limit users from bypassing CloudFront if edge protection is required.

Cache Behaviors select origin

Path patternOriginRequest example
/images/*S3/images/logo.png
/api/*ALB/api/orders
Default (*)On-premises server/home
  • CloudFront reviews behaviors in the configured order and use the first matching behavior; Do not choose the most specific pattern yourself. If individual behavior does not match, use Default Cache Behavior (*).

Private S3 and OAC

  • OAC signs request from CloudFront, bucket policy for distribution is read; No need to open a public bucket.
  • Object SSE-KMS also needs a suitable KMS key policy.
  • S3 REST bucket origin is different from S3 website endpoint.
  • The website endpoint is a custom HTTP origin, not using OAC in the way of a private bucket origin.

TLS and edge protection

  • Custom domains need a certificate with the correct name.
  • ACM certificate for viewer → CloudFront must be in us-east-1; certificate for origin is a separate leg. AWS CloudFront certificate requirements.
  • WAF filters application requests; Shield helps protect against DDoS; signed URL/cookie controls viewer access to private content.
  • OAC grants CloudFront permission to read S3, without authenticating each user.

4. Practical example

European users retrieve images from a nearby edge instead of repeatedly accessing a Singapore bucket.

Global website/photo/video: CloudFront + S3. Private app needs edge delivery: VPC origin is suitable. HTTP(S) API: behavior/cache policy according to content and security requirements.

5. Comparison

CloudFront delivers content; S3 stores origin objects; Global Accelerator optimizes networking without caching.

CloudFront Video Streaming (VOD vs Live) & Custom Domain HTTPS

Streaming typeStandard architecture on AWSCache mechanism on CloudFront
Video On-Demand (VOD)S3 (Origin) → CloudFront → UsersDirectly cache static video files/segments stored on S3
Live StreamingCamera → Elemental MediaLive (encode) → MediaPackage (segments/playlist) → CloudFrontCloudFront does not encode but cache each created segment immediately (manifest keeps TTL short)
  • Custom Domain HTTPS on CloudFront: 1.
  • Apply for Public Certificate in ACM at Region us-east-1 2.
  • Declare Alternate Domain Name (CNAME) on CloudFront + attach ACM certificate 3.
  • Create Route 53 A/AAAA Alias pointing the domain name to CloudFront Distribution
CloudFront caching, delivery controls & geo restriction

1. Concept

CloudFront uses cache keys to select responses, TTLs to determine cache duration, and policies to control delivery.

2. Purpose

Cache the right content, update it at the right time and limit who can receive the content.

3. How it works

Cache stream:

Viewer requests
↓ Cache keys
CloudFront edge
├─ hit → cached response
└─ miss → origin → response / cache according to policy

Cache key

  • Cache key: The information CloudFront uses to decide whether two requests can share one cached response.
  • Components: Includes the path and can include query strings, headers, or cookies that change the response.
  • Example: Pages using ?lang=vi and ?lang=en need language in the cache key if they return different content.
  • Too many values: Each variation creates another cache entry, reducing reuse of cached content.
  • Missing values: Users may receive the wrong content. Private user data needs safe caching rules or no caching.

Cache policy and origin request policy

  • Cache policy determines key/TTL. Origin request policy transfers additional information to origin even though it is not in the key.
  • Forward header/cookie does not by itself guarantee a unique response.
  • Check cache behavior with origin's Cache-Control, especially minimum TTL and sensitive data.

TTL, file version and invalidation

  • TTL regulates cache time.
  • Origin changes the file without automatically making every edge get a new version immediately.
  • Use a version name like app.abc123.js for assets that don't change; HTML can have short TTL more.
  • Invalidation removes path from cache before TTL: /index.html, /images/* or /*.
  • Wildcard path helps delete many objects but invalidation still has quota/cost; It is not a mechanism to backup or repair the original file.

Signed URL and signed cookie

  • Signed URL matches a specific file; signed cookie merges multiple files such as videos many segments.
  • Both control the duration/conditions of private content access via CloudFront.
  • Block direct access to the origin if you want every user to pass this check.
  • S3 pre-signed URL is another mechanism, granting requests directly to S3 with signer permissions.

Geo restriction

  • Allowlist/blocklist by country in distribution based on Geo-IP.
  • VPN/proxy may affect location identification; do not change authentication/authorization by user.

Price Class

  • Price Class Choose a group of edge locations serving distribution to balance costs and latency.
Price ClassScopeTarget
100America, Canada, Europe, IsraelLimited to lower cost areas
200Class 100 + many regions in Asia, Africa, Middle East; There is VietnamBalance cost and coverage
AllAll CloudFront edge locationsLargest global coverage
  • For example, customers in Vietnam: Class 100 does not include edge in Vietnam, so you may have to go further; Class 200 includes Vietnam so latency can be reduced; All opens the entire edge network.
  • Actual costs depend on traffic and service area.
  • Price Class does not block users by location. People outside the range can still access it; If you want to restrict countries, use Geo Restriction/WAF.

Viewer Protocol Policy

PolicyMeaning
HTTP and HTTPSAllows both protocols
Redirect HTTP to HTTPSConvert HTTP viewer to HTTPS; HTTP/1.0 requests using write methods may be rejected
HTTPS OnlyOnly for HTTPS; HTTP returns 403
  • Policy applies to the leg viewer → CloudFront; The CloudFront → origin route has its own protocol policy.

Automatic Compression (Gzip/Brotli) & 4 Viewer/Origin Events hook points

  • Automatic Compression: when the browser sends Accept-Encoding: br, gzip, CloudFront automatically compresses eligible files using Brotli/Gzip at Edge, compressed and paid cache Content-Encoding.
Event HookRunning timeSupported by
Viewer Request / Viewer ResponseEvery request from the user to Edge and before returning (even when Cache HIT)CloudFront Functions & Lambda@Edge
Origin Request / Origin ResponseOnly runs when Cache MISS and Edge must call OriginOnly Lambda@Edge

4. Practical example

A website releases app.v2.js so long-lived caching can coexist with correct version delivery.

JS/CSS versioned: Long TTL. Quickly changed HTML: invalidation. Paid content per file: signed URL; multiple video segments: signed cookie. The content varies by query: the cache key contains the necessary query.

5. Comparison

A cache policy defines cache keys and TTLs; an origin request policy forwards additional information to origins.

AWS Global Accelerator

1. Concept

Global Accelerator accepts users through static IP addresses and routes connections over the AWS network to suitable application endpoints.

2. Purpose

Bring TCP/UDP traffic into the AWS network near the client, keep the IP stable and transfer it to a healthy endpoint.

3. How it works

Anycast and network line

  • Anycast = multiple network points broadcast the same IP;
  • The client goes to the appropriate edge and then traffic follow the AWS backbone to the endpoint.
Client → static Anycast IP → AWS edge → AWS backbone → regional endpoint
  • Global Accelerator IPv4 typically provides two static IPv4; dual-stack adds IPv6.
  • IP stays stable when changing backend, useful for firewall allowlist.

Endpoints and health

  • Endpoint group by Region contains ALB, NLB, EC2 or EIP according to the supported configuration.
  • Health controls where traffic is received; Endpoint weight and traffic dial adjustable distribution.
  • Traffic dial changes the rate of traffic entering a Region; endpoint weight divided in group. group.
  • When there is an error, the service changes network routing without having to wait for the client to run out of DNS cache get a new IP.

No cache

  • Global Accelerator accelerates the network, does not cache HTTP objects.
  • New content is still coming to the app; TLS, authentication and request control remain needed at the endpoint/application.
  • Do not confuse the Global Accelerator's static IP with the AZ static IP of an NLB: Accelerator sends global traffic to regional endpoints.

Target Endpoint types supported by Global Accelerator

  • Global Accelerator routes to all Internet-facing ALB/NLB, Internal ALB/NLB, EC2 Instances and Elastic IP in one or more Regions without exposing the internal network structure.

4. Practical example

A multi-Region UDP game uses stable IP addresses and routes players to appropriate healthy endpoints.

UDP game, VoIP, global TCP app; Multi-Region APIs need stable IP allowlists and quick transitions from faulty endpoints. Website needs to cache images/videos near the user: consider CloudFront.

5. Comparison

Global Accelerator optimizes TCP/UDP; CloudFront delivers HTTP(S) through a CDN with content caching.

CloudFront vs Global Accelerator vs S3 CRR

1. Concept

CloudFront delivers content, Global Accelerator improves connection paths, and S3 CRR copies data to another Region.

2. Purpose

Distinguish between content acceleration, network acceleration and persistent data replication.

3. How it works

Three mechanisms:

  • CloudFront = HTTP(S) delivery + cache
  • Global Accelerator = TCP/UDP acceleration, no cache
  • S3 CRR = copy object to another Region

Cache is different from replica

  • CloudFront cache may evict or run out of TTL; origin is still the data source.
  • CRR creates a real object in the destination bucket, requires Versioning and permission; The app that wants to read the target version must access the correct bucket/endpoint.
  • Do not use CloudFront cache instead of backup/DR for S3.
  • CRR does not automatically distribute HTTP to the edge or automatically move all clients to a backup bucket.

CloudFront is different from Accelerator

  • CloudFront understands HTTP and has cache behavior, signed URL/cookie, geo restriction.
  • Global Accelerator handles TCP/UDP and static IP routes; no key cache/TTL like CDN.
  • HTTP app can also use Accelerator when a fixed IP/network failover is needed.
  • Choose according to the main requirement, not just based on the word “global”.

4. Practical example

A website uses CloudFront for fast image delivery and CRR for a backup copy in another Region.

Photo website: CloudFront. Multi-Region UDP Game: Global Accelerator. Object needs another Region copy: CRR. It's possible to have CRR for DR and CloudFront for delivery, but you still have to configure origin/failover accordingly.

5. Comparison

  • An edge cache entry can be evicted;
  • a replica in a destination bucket is stored data governed by replication settings.

Comparison table

MechanismWhat to do?When choosing
CloudFrontCDN for HTTP(S), caches at the edge and passes requests to the originWeb/API, photos, videos, signed content
Global AcceleratorTCP/UDP over AWS backbone with static Anycast IP, no cacheGlobal app, IP allowlist, network failover
S3 CRRReplicate object to bucket in another Region, asynchronouslyDR, compliance, data must have a regional copy

AWS Storage Extras

AWS Snow Family

1. Concept

Snow Family uses physical devices for data transfer or local processing where connectivity is limited, subject to product availability.

2. Purpose

Understand how to transfer data using a physical device when transferring over the network takes too long or the workplace lacks connectivity.

3. How it works

Why use equipment?

  • Hundreds of TB via slow transmission can take weeks/months.
  • Snowball Edge copies data on-premises and then transports the device to AWS for import into S3.
Create job → receive device → copy data → send back to AWS → import to S3
  • Compare network transmission time with receive/copy/send/import time; Actual bandwidth, cost and deadline must also be considered.

Snowball Edge and edge compute

  • Storage Optimized prioritizes capacity; Compute Optimized prioritizes processing at the place of data creation.
  • Edge compute integrates data filtering, inference or media processing at low-Internet sites before sending data to the cloud.
  • Data on the device is encrypted;
  • Key management, job credentials and shipping are still important parts of the process.

Import and archive

  • Import into S3 and then use Lifecycle to switch to the appropriate Glacier layer, do not choose the "Snowball import directly into Glacier vault" route.
  • Do not use the device for continuous synchronization that requires frequent updates; online recurring copy is more suitable for DataSync.

Note current availability

  • From November 7, 2025, Snowball Edge is only available to existing customers.
  • The Snowcone/Snowmobile in the old document is not the new option that is always available.
  • Keep the concept of offline migration for learning, but when implementing, check the service/solution currently provided. AWS Snowball availability.

4. Practical example

A site with a slow WAN needs to transfer a large dataset after verifying device availability for its account.

Data center has a lot of data and limited WAN: offline bulk transfer if eligible. Site disconnected needs to be handled locally: edge compute. The NAS has a good enough connection and needs scheduled copying: DataSync.

5. Comparison

Snow supports eligible offline transfers; DataSync transfers over networks; Direct Connect provides connectivity.

Amazon FSx managed file systems

1. Concept

FSx provides AWS-managed filesystems with Windows, Lustre, ONTAP, and OpenZFS options.

2. Purpose

Choose a managed file system with protocols and features suitable for the existing application.

3. How it works

  • Types of file systems: FSx for Windows File Server · FSx for Lustre · FSx for NetApp ONTAP · FSx for OpenZFS

FSx menu

TypeProtocol/strengthsSuitable
Windows File ServerSMB, NTFS, Active DirectoryWindows share, home directory, app Windows
LustreParallel file system, S3 integrationHPC, ML training, media processing
NetApp ONTAPNFS/SMB/iSCSI, ONTAP featureNAS/NetApp migration, multi-protocol
OpenZFSNFS, snapshot/clone/compression ZFSLinux/ZFS workload needs low latency

Windows File Server

  • Integrated AD, file permissions/ACL and user quotas.
  • Linux clients can also mount SMB; This is not an EC2 Windows-only service.
  • Multi-AZ deployment improves availability; Backup protects data.
  • On-prem access via VPN/DX with appropriate route, SG and file permissions.
  • Windows SMB shares often choose Windows FSx instead of EFS NFS.

Luster and S3

  • FSx for Lustre: Lets many machines read and process files at high speed, useful for scientific computing or model training.
  • S3 integration: Reads an S3 dataset as files and exports results back to S3.
  • Scratch: For temporary processing; it does not replicate data to protect against file server failure as Persistent does.
  • Persistent: For longer workloads and data that must be retained. Choose a deployment for its durability needs; FSx options have different failure protection.

ONTAP and OpenZFS

  • ONTAP is suitable for applications that rely on NetApp, multiple protocols, snapshots/clones and tiering.
  • OpenZFS is suitable for ZFS/NFS applications and corresponding snapshot/clone features.
  • Quick Clone does not replace independent backup.
  • Encrypt at rest using KMS; encryption in transit and file permissions depend on protocol/filesystem.

Integrate S3, Single-AZ/Multi-AZ & Storage tier of 4 FSx series

FSx seriesSingle-AZ / Multi-AZStorage optionsHow to integrate S3
FSx for Windows File ServerBothSSD / HDDCopy data over AWS DataSync
FSx for LustreSingle-AZ (file server)SSD / HDD / Intelligent-TieringOriginal link Data Repository Association (DRA) Automatically import metadata & export HPC results to S3
FSx for NetApp ONTAPBothSSD + Capacity Pool (Auto Tiering)Mount S3 Access Points (read/write via S3 API while data remains on FSx)
FSx for OpenZFSBothSSD / Intelligent-TieringMount S3 Access Points or switch to DataSync
  • FSx for Lustre Intelligent-Tiering Automatically transfer data through 3 layers: Frequent Access (< 30 days) → Infrequent Access (≥ 30 days) → Archive Instant Access (≥ 90 days); This mode's data has multi-AZ persistence but components Luster file server still runs Single-AZ.

4. Practical example

A company moves Windows file shares to FSx for Windows while retaining Active Directory sign-in.

Company Windows share + AD: FSx Windows. HPC reads dataset S3: Luster. Lift-and-shift NetApp NAS: ONTAP. Workload is using ZFS: OpenZFS. Shared Linux files across multiple AZs: compare EFS first.

5. Comparison

FSx Windows supports SMB/AD; Lustre targets HPC; ONTAP/OpenZFS serve their respective filesystem requirements; EFS uses NFS.

AWS Storage Gateway

1. Concept

Storage Gateway connects on-premises applications to AWS storage through familiar file, volume, or tape interfaces.

2. Purpose

For on-prem applications to use the familiar file/block/tape protocol with storage in AWS.

3. How it works

Gateway and local cache

  • Gateway: An appliance or software at your site that connects existing applications to AWS storage.
  • Local cache: Keeps frequently used data near the application for faster reads; data moves to AWS according to the selected gateway type.
  • Example: An office keeps using a familiar network drive while the data is stored in AWS.
  • Comparison: Storage Gateway provides ongoing access between on-premises systems and the cloud; DataSync runs transfer tasks and Snowball uses shipped devices.

S3 File Gateway

App on-prem --NFS/SMB--> File Gateway + cache --HTTPS--> S3 objects
  • The app sees the file share, S3 saves the object.
  • Gateway has IAM role to access bucket; SMBs can use AD.
  • Share/file permissions and S3 permissions are classes that need to be configured.
  • Do not consider the local cache as a permanent place for all data or that the gateway file is a shared POSIX filesystem like EFS.

Volume Gateway

  • Provide block volumes via iSCSI.
  • Cached volumes keep the main data in AWS, caching the portion in use locally to reduce local storage.
  • Stored volumes keep all core data on-premises and backed up to AWS.
  • Backup uses EBS snapshots to serve restore.
  • Stored is suitable when you need to access the entire dataset with local latency; cached is suitable when you want to reduce on-prem capacity.

Tape Gateway

  • Provides iSCSI virtual tape library (VTL) for existing backup software.
  • Tape stored on AWS, can be archived to Glacier Flexible Retrieval/Deep Archive according to configuration.
  • No more buying and shipping physical tape; Restoring tape archives still has retrieval time/costs to consider.

4. Practical example

Legacy backup software writes to Tape Gateway's virtual tape library without changing its tape workflow.

NFS/SMB share backed by S3: File Gateway. Block storage on-prem with cloud backup: Volume Gateway. Replace the tape library but keep the backup software: Tape Gateway.

5. Comparison

A gateway provides ongoing hybrid access; DataSync copies data in tasks; Transfer Family accepts files from clients.

Compare Volume Gateway: Cached Volumes vs Stored Volumes

CriteriaCached VolumesStored Volumes
Where full original data is keptAbove Amazon S3 (managed by Storage Gateway)Right now On-premises to access the entire dataset locally
On-premises disk space requiredShow Cache (recently read data) + Upload BufferEntire volume capacity + Upload Buffer
Backups on AWSVolume + EBS Snapshots scheduledBackup asynchronously to S3 as EBS Snapshots
AWS DataSync & Transfer Family

1. Concept

DataSync moves data between storage systems; Transfer Family lets partners transfer files using protocols such as SFTP.

2. Purpose

Distinguish between copying data between the storage system and the endpoint receiving files from users/partners.

3. How it works

DataSync

  • DataSync runs the task of transferring data between supported storage such as NFS/SMB/HDFS/object storage and S3/EFS/FSx.
  • There is scheduling, data checking, bandwidth limit and transmission over TLS.
NAS on-prem → DataSync agent/task → S3 / EFS / FSx
  • On-prem file storage often requires an agent; AWS-to-AWS in the same regular account no agent needed.
  • Some cloud/cross-account sources have different rules by location and task mode.

Metadata and sync

  • It is possible to keep permissions/metadata supported in source/destination pairs.
  • Copying NFS to S3 does not turn S3 into a POSIX filesystem with full file permissions as the source.
  • This is a transfer task that runs on schedule or on demand, not CDC database or real-time filesystem replication. AWS metadata behavior.

Transfer Family

  • Transfer Family: Provides an AWS-managed file transfer server; partners use familiar SFTP, FTPS, or FTP clients to send files to S3/EFS where the protocol is supported.
  • AS2: A separate option for business-to-business data exchange, using supported storage destinations.
  • Login and permissions: Depending on the protocol, use service-managed accounts, AD, or a custom identity provider. IAM and filesystem permissions limit each user's file access.
  • FTP: Unencrypted and restricted to VPC endpoints; unsuitable for sensitive files over the Internet.
Partners using SFTP client → Transfer Family → S3 prefix are authorized

Select by task

RequestSelect
Copy large NAS to AWS, with schedule/verificationDataSync
Partners still use SFTP client to send filesTransfer Family
On-premises apps continue to use hybrid file/block/tapeStorage Gateway
Just need a private network lineVPN/Direct Connect; Also need transfer tool

4. Practical example

Partners upload files over SFTP to S3 through Transfer Family; internal NFS data moves with DataSync.

Migration NFS → EFS: DataSync. Scheduled file synchronization: DataSync. Instead of self-managed SFTP server, data goes to S3: Transfer Family.

5. Comparison

DataSync suits storage migration and synchronization; Transfer Family suits partner-facing file-transfer protocols.

Transfer Family: SFTP Server vs Connector & Identity Providers

ComponentThe active party opens the connectionData stream
Transfer Family Server (SFTP Server)External partner clients connect to your EndpointClient actively Uploads or Downloads files from S3 / EFS
Transfer Family Connector (SFTP Connector)AWS is proactive Connect to the partner's external SFTP ServerExecute command SEND (S3 → partner) or RETRIEVE (partner → S3)
Identity Provider on Transfer FamilyUser authentication mechanism
Service-managed usersTransfer Family stores username + directly SSH Public Key and private S3/EFS directory mapping
AWS Managed Microsoft AD / AD ConnectorSign in with a business Active Directory account
Custom IdP (Lambda / API Gateway)Integrates external identity store, supports custom password + SSH key
AWS storage selection guide

1. Concept

Choose storage for how the application reads and writes: disks, shared files, objects, or transfers from existing systems.

2. Purpose

Choose storage based on how the application accesses data first, then consider durability, latency and cost.

3. How it works

Select according to how the application reads/writes:

Block → EBS
Shared File → EFS / FSx
Object → S3
Local temporary disk → Instance Store

Block, file or object?

DemandService
Object/API, data lake, static assets, backupS3
Disk for EC2, boot or databaseEBS
NFS/POSIX files are shared by many Linux clientsEFS
SMB/AD or specialized file systemFSx
Local disk is very fast, data can be recreatedInstance Store
  • Do not choose S3 as disk mount for databases that need block I/O.
  • Don't choose EBS so that multiple apps across AZs can share files.
  • Archive object: select the S3 Glacier class according to the required retrieval time.

Where is the data located and can it be lost?

  • EBS is in one AZ, if you want to go to another AZ, you need a snapshot/restore.
  • Regional EFS across multiple AZs; One Zone reduces fees but accepts AZ risk.
  • Instance Store loses data over the instance/host life cycle.
  • FSx has different deployments; Check HA/backup of specific type.
  • Backup prevents accidental deletion; replication/failover serves availability, not replacement replace each other.

Hybrid access or migration?

TaskService
Continue file/block/tape at on-prem, AWS backendStorage Gateway
Online bulk copy/sync has verificationDataSync
Receive SFTP/FTPS files from partnersTransfer Family
Offline bulk transferSnowball/physical transfer solutions are also available

4. Practical example

An application needing shared Linux files chooses EFS; an analytics team stores object-based lake data in S3.

Windows shared drive: FSx Windows. WordPress multiple EC2: EFS. Separate DB Disk: EBS io2/gp3 by I/O. Data lake: S3. Before closing, check RPO/RTO, throughput, encryption and transfer/retrieval cost.

5. Comparison

Identify block, file, or object access first; then compare durability, performance, AZ scope, and cost.

SQS, SNS, Kinesis & Amazon MQ

Amazon SQS

1. Concept

SQS queues work so the application submitting jobs and the application processing them need not run at the same speed.

2. Purpose

Use managed message queue to:

3. How it works

  • Decouple producers and consumers · Asynchronous processing · Buffer traffic spike · Retry workload when consumer fails

Basic flow:

Producer
↓ SendMessage
SQS Queue
↓ ReceiveMessage
Consumer
↓ processing
DeleteMessage

Why do we need SQS?

If the producer calls the consumer directly:

Producer
↓
Consumer
  • Consumer is slow/error → producer is also affected.

With SQS:

Producer
↓
SQS Queue
↓
Consumer
  • SQS keeps messages temporarily so: Producer scale independent · Consumer scale independent · Traffic spike is buffered

For example:

Web App
↓ 1,000 video jobs
SQS
↓
Workers handle it gradually

SQS = decouple + async + buffer.

Message Lifecycle

Producer
↓ SendMessage
SQS
↓
Consumer ReceiveMessage
↓
Process
↓
DeleteMessage
  • Producer: An application sends a job to SQS with SendMessage, such as an order confirmation email.
  • Consumer: An application receives the job with ReceiveMessage and processes it. Receiving a message does not delete it.
  • Successful processing: The consumer calls DeleteMessage to remove the job from the queue.
  • Failed processing: If it was not deleted, the message becomes visible after its visibility timeout so a consumer can retry.
Message
↓
Visibility Timeout is over
↓
Visible again
↓
Another consumer retry

Visibility Timeout

  • Visibility Timeout: The time SQS temporarily hides a message after a consumer receives it, so another consumer does not immediately take the same job.
  • Successful processing: The consumer must call DeleteMessage; expiration of the timeout does not delete the message.
  • Unfinished processing: The message becomes visible again when the timeout expires. Consumers must tolerate receiving the same job again.
  • Configuration: The default is 30 seconds and the maximum is 12 hours. Use ChangeMessageVisibility to adjust it during processing.
  • Choosing a duration: Too short can cause duplicate processing; too long delays retry after a consumer fails.
Message
↓ Receive
Temporarily invisible
↓
Consumer processing
DeleteMessage
↓
Messages disappeared
Visibility Timeout is over
↓
The message reappears
↓
Retry
Timeout is too short
→ duplicate processing

Timeout is too long
→ slow retry when consumer crashes

Visibility Timeout = time the message is hidden while being processed.

Dead-Letter Queue (DLQ)

If an error message persists:

Receive
↓ fail
Retry
↓ fail
Retry
↓
maxReceiveCount
↓
DLQ
  • DLQ is used to hold: Poison messages · Messages error processing multiple times
  • → help debug or reprocess later.
Main Queue
↓ fail many times
DLQ

SQS Standard Queue

  • SQS Standard: A queue for large volumes of work when strict ordering is not required.
  • At-least-once delivery: A message can be delivered again even if it was received before.
  • Best-effort ordering: SQS attempts ordering but does not guarantee every message arrives in send order.
  • Example: Before charging order 123, check whether the transaction was already processed so a repeated message does not charge twice.
Order ID = 123
↓ 1st processing
↓ duplicate
second processing

SQS FIFO Queue

  • FIFO is used when needed: Strict ordering + Deduplication
  • Queue name must: *.fifo
1
2
3
↓
FIFO Queue
↓
1
2
3
  • Ordering is guaranteed in: MessageGroupId
customer-A
↓
1 → 2 → 3

While:

customer-B
↓
1 → 2 → 3
  • Two different groups can process in parallel.
  • Multiple MessageGroupIds = increase parallelism

If there is only 1 group:

every message
↓
sequential processing
  • → lower throughput.

FIFO Deduplication

  • FIFO supports: MessageDeduplicationId; or: Content-Based Deduplication; to avoid sending the same message multiple times in the deduplication window.
  • FIFO deduplication ≠ business exactly-once processing
  • Consumers should still design idempotent.

Message Size & Retention

  • Maximum messages: 1 MiB

If payload is larger:

Large payload
↓
S3
↓
SQS only sends S3 reference

Retention:

Default
= 4 days

Configurable
= 1 minute → 14 days
  • Messages exist until: DeleteMessage · or · Retention exhausted

Long Polling

  • Consumer calls: ReceiveMessage

If using short polling:

No messages
↓
Return empty response immediately

Long polling:

ReceiveMessage
↓
SQS waits for messages
↓ maximum 20 seconds
Message arrives → pay immediately
  • Advantages: Fewer empty responses · Fewer API calls · Reduced polling costs
  • Frequently used: WaitTimeSeconds = 20

Scaling Consumers

Queue can be a buffer between:

Web Tier
↓
SQS
↓
Processing Tier
  • Consumers can be: EC2 · Auto Scaling Group · Lambda

When backlog increases:

Queue depth increased
↓
CloudWatch
↓
Scale out consumers
  • Commonly used metrics: ApproximateNumberOfMessagesVisible
  • Better yet, you can use: Backlog per instance = Queue depth / number of consumers
  • → Producer and consumer do not need to scale together.

SQS + Lambda

Popular flows:

Producer
↓
SQS
↓
Lambda
↓
Process messages
  • Lambda will scale consumers based on the backlog.
  • SQS helps: Buffer burst · Retry failed processing · Decouple producer from Lambda

Security

1. In Transit

HTTPS / TLS

2. At Rest
  • Can be used: SSE-SQS

SSE-KMS

If using KMS customer managed key:

Principal
↓
Needs appropriate KMS permissions

IAM and Queue Policy

  • IAM Policy controls: sqs:SendMessage · sqs:ReceiveMessage · sqs:DeleteMessage
  • Queue Policy is: Resource Policy · directly attached to SQS Queue

Often used for:

Cross-account
SNS → SQS
S3 → SQS
SNS Topic
↓
Queue Policy allowed
↓
SQS Queue
  • Can be limited by: aws:SourceArn

Overall flow

Producer
↓
SendMessage
↓
SQS Queue
↓
Consumer ReceiveMessage
↓
Visibility Timeout
↓
Process
↓
DeleteMessage

If error:

No Delete
↓
Message is visible again
↓
Retry
↓
maxReceiveCount
↓
DLQ

4. Practical example

A website queues email jobs in SQS; workers process them as order volume spikes.

Decouple application components
↓
SQS
Traffic spike / burst
↓
SQS buffer
Async background jobs
↓
SQS
Strict ordering by customer/order
↓
FIFO

5. Comparison

Standard prioritizes throughput with at-least-once delivery; FIFO preserves per-group ordering and supports deduplication.

Standard vs FIFO

StandardFIFO
ThroughputVery highLower/limited
DeliveryAt-least-onceDeduplication helps avoid duplicate sends
OrderingBest-effortStrict in MessageGroupId
Use caseJob processing, async workloadsOrder/customer workflow requires order

Quick select:

No need for strict order
↓
Standard
Need to be in the correct order according to customer/order
↓
FIFO

SQS vs SNS

Points that are easy to confuse: SQS = Queue = a message processed by a consumer

SNS = Pub/Sub = one fan-out message to many subscribers

If multiple systems need the same event:

Producer
↓
SNS Topic
├─ SQS Queue A
├─ SQS Queue B
└─ SQS Queue C

→ Each system has its own queue.

Amazon SNS

1. Concept

SNS sends one notification to multiple subscribers, such as email and order-processing systems.

2. Purpose

Using pub/sub push format for a publisher to send the same event to many subscribers.

3. How it works

Publisher
↓ Publish
SNS Topic
├─ SQS
├─ Lambda
├─ Email / SMS
└─ HTTP(S)

SNS = Pub/Sub + Push + Fan-out.

Topic, Publisher & Subscriber

  • Producers just need to publish to: SNS Topic
  • SNS will push messages to appropriate subscriptions.
Publisher
↓
SNS Topic
↓
Subscribers
  • Popular subscribers: SQS · Lambda · Amazon Data Firehose · HTTP / HTTPS · Email · SMS · Mobile Push
  • → Publisher does not need to know how many consumers are behind it.

SNS Fan-out

A message can be sent to multiple systems:

Order Created
↓
SNS Topic
├─ Fraud Queue
├─ Shipping Queue
└─ Analytics Queue
  • Each subscriber receives a copy of event.
  • This is called: Fan-out

SNS + SQS

Pattern is very important:

Producer
↓
SNS Topic
├─ SQS Queue A
├─ SQS Queue B
└─ SQS Queue C
  • SNS: = fan-out event
  • SQS: = keep message = retry = buffer = consumer processes at its own pace

For example:

Order Created
↓
SNS
├─ Fraud SQS
├─ Payment SQS
└─ Shipping SQS
  • → Each system is independent, a slow consumer does not affect other consumers.

Queue Policy must allow:

SNS Topic
↓ sqs:SendMessage
SQS Queue

Subscription Filter Policy

Default:

There is no Filter Policy
↓
subscriber receives every message

Filter Policy available:

SNS Topic
↓
Filter Policy
↓
Only suitable messages
↓
Subscriber
OrderStatus = Placed
↓
Shipping Queue
OrderStatus = Cancelled
↓
Cancellation Queue
  • → No need to create multiple SNS topics just to separate message types.

AWS Services → SNS

  • Many AWS services can send notifications to SNS.
  • Important examples: CloudWatch Alarm · S3 Event · Auto Scaling · AWS Budgets · Lambda · RDS Events
CloudWatch Alarm
↓
SNS Topic
↓
Email / SMS / Lambda

SNS Security

1. In Transit

HTTPS / TLS

2. At Rest
  • Can be encrypted with: SSE-KMS
3. Access Control
  • IAM Policy = who called the SNS API
  • SNS Topic Policy = resource policy of Topic

Topic Policy is often used for:

Cross-account

or

AWS Service
↓
publish to SNS
S3
↓ Topic Policy allowed
SNS Topic

If using customer managed KMS key:

Publisher / AWS Service
↓
Needs appropriate KMS permissions

SNS FIFO Topic

  • SNS also supports FIFO when needed: Ordering + Deduplication
  • Ordering is based on: MessageGroupId
  • Deduplication uses: MessageDeduplicationId; or: Content-Based Deduplication

Pattern when needing fan-out but still maintaining order:

Producer
↓
SNS FIFO Topic
↓
SQS FIFO Queue
↓
Consumer
  • → suitable when needed: Fan-out + Ordering + Deduplication

S3 Fan-out Pattern

If an S3 event needs to trigger multiple pipelines:

S3 ObjectCreated
↓
SNS Topic
├─ SQS Queue A
├─ SQS Queue B
└─ Lambda
  • → publish once but many systems receive the event.

Overall flow

Publisher / AWS Service
↓
SNS Topic
↓
Subscription Filter
↓
SQS / Lambda / Firehose
HTTP(S) / Email / SMS

4. Practical example

An order event fans out to separate SQS queues for payments, shipping, and analytics.

An event
↓
many consumers need to receive
↓
SNS
Notification
Email / SMS / HTTP
↓
SNS
Fan-out to multiple queues
↓
SNS + SQS
Fan-out + strict ordering
↓
SNS FIFO + SQS FIFO

5. Comparison

SNS fans out to subscribers; SQS holds work for consumers to process; the services can be combined.

SNS vs SQS

Extremely confusing point:

SNS
= Pub/Sub
= push
= 1 message → many subscribers

SQS = Queue = Consumer poll = buffer / retry

1 event
↓
Many systems need to receive
↓
SNS
1 job
↓
Need worker to handle async
↓
SQS

If both are needed:

SNS
↓ fan-out
multiple SQS queues
↓
Each consumer processes independently
Amazon Kinesis Data Streams

1. Concept

Kinesis Data Streams retains continuous data so multiple applications can read independently and replay it during retention.

2. Purpose

Collect and save real-time streaming data for multiple consumers to process independently.

3. How it works

Producers
↓
Kinesis Data Stream
↓
Shards
↓
Consumers
  • KDS is suitable when needed: Real-time streaming · High-volume events · Ordering · Multiple consumers · Replay data

Data flow

  • Producers can be: Application · IoT Device · Clickstream · Logs / Metrics · Kinesis Agent
  • Consumers are usually: Lambda · Application / KCL · Amazon Data Firehose · Apache Flink
Producer
↓
Partition Key
↓
Kinesis Stream
↓
Shard
↓
Consumer

Shard & Partition Key

  • Shard: A part of a Kinesis stream that receives and stores some of its records.
  • Partition Key: A value on each record that Kinesis uses to choose a shard, such as customer-123 for that customer's events.
  • Same Partition Key: With key-based routing, records go to the same shard. For send ordering, use sequential PutRecord calls; batched PutRecords does not guarantee ordering.
  • Ordering scope: Ordering is within a partition key in a shard, not one global order across the entire stream.
Record
↓
Partition Key
↓ hash
Shard
customer-123
↓
Shard A
customer-123
Event 1
Event 2
Event 3
↓
same shard
↓
keep the correct order

Hot Shard

If partition keys are unevenly distributed:

Many records
↓
same Partition Key
↓
with Shard
↓
Hot Shard
  • Bad example: Partition Key = "default"
  • → Almost all records are put into one shard.
  • You should choose a well-distributed key such as: Customer ID · Device ID · User ID

Retention & Replay

  • KDS does not delete records immediately after the consumer reads them.
Record
↓
Kinesis Stream
↓
kept in retention period

According to the slides:

24 hours
→
365 days

During that time:

Consumer A → read
Consumer B → read
Consumer C → replay
  • → multiple consumers can process the same data independently.
  • Other points of SQS: SQS = message is processed by consumer and then deleted
  • Kinesis = record still exists in retention = can be replayed

Capacity Modes

  • There are 2 modes: Provisioned · On-Demand
1. Provisioned
  • You manage the shard number.
  • Each shard follows the slide: Write = 1 MB/s or 1,000 records/s
  • Read = 2 MB/s

If traffic increases:

Traffic increased
↓
add shards
  • → suitable when the throughput is relatively predictable.
2. On-Demand
Does not self-manage shard numbers
↓
Kinesis self-scales capacity
  • → suitable for workloads that are difficult to predict or want to reduce capacity management.

Throughput/pricing details may vary by AWS; remember priority Provisioned = shard management, On-Demand = AWS scales itself.

Consumer Throughput

  • There are 2 main ways of reading.
1. Shared / Standard Consumer
Shard
↓
many consumers
↓
share read throughput
  • Multiple consumers reading at the same time will share the capacity of the shard.
2. Enhanced Fan-Out
Shard
├─ Consumer A → 2 MB/s
├─ Consumer B → 2 MB/s
└─ Consumer C → 2 MB/s
  • Each registered consumer has: 2 MB/s / shard / consumer
  • → suitable when many consumers need to read the stream with high throughput and low latency.

KPL & KCL

1. KPL
  • Kinesis Producer Library = supports producers in sending records effectively
2. KCL
  • Kinesis Client Library = supports consumers reading shards + coordinating multiple workers + checkpoint
  • Checkpoint Help consumers remember: Which record has been processed?; to continue processing after restart/failure.

Data Size & Storage

  • According to slide v48: Record max = 10 MiB
  • KDS is suitable for: Multiple streaming records · sent continuously

KDS only keeps data during the retention period:

  • Kinesis = temporary streaming storage ≠ long-term data lake

If you need to save long term:

Kinesis
↓
Firehose / Consumer
↓
S3

Security

1. In Transit

HTTPS / TLS

2. At Rest
  • KMS Encryption
  • Access control: IAM · Resource Policy
  • Can be used: VPC Endpoint; Traffic to Kinesis does not need to go through the public Internet.

Overall flow

Producers
↓
Partition Key
↓
Kinesis Data Stream
↓
Shards
↓
Lambda / KCL / Flink / Firehose
↓
Real-time Processing / Analytics / S3

4. Practical example

One consumer analyzes website clickstream for fraud while another calculates real-time metrics.

Website clickstream
↓
Kinesis
IoT telemetry
↓
Kinesis
Logs / metrics real-time
↓
Kinesis
One stream
↓
many independent consumers
↓
Kinesis
Need to replay old data
↓
Kinesis

5. Comparison

A stream retains events after reading for replay; queues such as SQS normally delete successfully processed messages.

Kinesis vs SQS

Mistaken points: SQS = Queue = async job processing = consumer processes then deletes

Kinesis = Stream = real-time data = many consumers read the same data = has retention + replay

Video processing job
↓
SQS
Clickstream / IoT / logs real-time
↓
Kinesis
Amazon Data Firehose

1. Concept

Data Firehose receives streaming data and delivers it to configured storage or analytics destinations.

2. Purpose

Bring streaming data to storage/analytics destination using managed service, not self-managing shard and consumer fleet.

3. How it works

Delivery pipeline

Producer / Kinesis Data Streams / logs
 → Firehose → buffer / optional transform → destination + backup S3 when configuring
  • Destination includes S3, Redshift, OpenSearch and HTTP/vendor supported. Delivery Redshift uses S3 as staging before COPY.

Buffer and latency

  • Buffer: Firehose collects data until a size or time threshold before delivering it, such as batching logs for S3.
  • Latency: Delivery is near real time but usually not instantaneous. It is not the default choice for reacting immediately to every event.
  • Zero buffering: Some destinations can reduce or skip buffering; Firehose still is not a stream where several consumers independently replay history.
  • Capacity: AWS manages delivery, but source and destination quotas and limits still apply.

Transform and format conversion

  • Lambda can transform records before delivery.
  • Format conversion native converts JSON to Parquet/ORC for S3, using Glue Data Catalog schema;
  • CSV needs to be transformed to JSON first, not directly converting all formats.
  • Compression/columnar format helps reduce storage and scan data when querying. AWS Firehose format conversion.

Replay, backup and permissions

  • Firehose does not provide retention streams for consumers to freely replay like Kinesis Data Streams does.
  • If multiple consumers/replays are needed, put KDS first and Firehose as a consumer delivery.
  • There are retry and S3 backup for all/failed records depending on destination/configuration.
  • Service role needs source, destination, Lambda and KMS permissions; Design error monitoring and reprocess backup data.

4. Practical example

Application logs pass through Firehose, convert to Parquet, and land in S3 for Athena queries.

Logs/clickstream → S3 data lake; data → Redshift/OpenSearch; Lambda transform → JSON → Parquet. Need to process real-time multiple consumers and read back events: Kinesis Data Streams.

5. Comparison

Firehose is a managed delivery pipeline; Data Streams provides a stream for custom consumers and replay.

Amazon MQ

1. Concept

Amazon MQ provides AWS-managed ActiveMQ or RabbitMQ brokers for applications using those messaging protocols.

2. Purpose

Use managed message broker for legacy applications that need traditional messaging protocols/APIs.

3. How it works

  • Amazon MQ = managed ActiveMQ / RabbitMQ = keep old protocol = lift-and-shift compatible

ActiveMQ & RabbitMQ

  • Amazon MQ supports: ActiveMQ · RabbitMQ
  • Clients still use: Native Library · Native Protocol
  • Broker can provide: Queue · ≈ same as SQS · Topic · ≈ same as SNS
  • but still retains the routing, acknowledgment and semantics of ActiveMQ/RabbitMQ.

High Availability

  • Amazon MQ can deploy multiple AZ brokers depending on engine/configuration.

For example:

  • AZ A · Active Broker · AZ B · Standby Broker

When active broker fails:

Active Broker fail
↓
Standby Broker
↓
Client reconnect
  • → increase High Availability.

According to the ActiveMQ architecture in the slide:

Active / Standby
↓
Shared EFS Storage

Network & Security

  • Broker runs in: VPC

Security Group controls:

Producer
Consumer
↓
broker connected or not
  • Commonly used authentication: Broker credentials · Native broker authorization
  • IAM is mainly used to manage: Create / Delete / Configure broker
  • You don't have to replace the broker credential for the data plane.
  • Encryption: In Transit = TLS
  • At Rest = KMS-backed encryption

Overall flow

Existing Producer
↓
AMQP / MQTT / STOMP / JMS...
↓
Amazon MQ Broker
↓
Queue / Topic
↓
Consumer

If the broker fails:

Active Broker
↓ fail
Standby Broker
↓
Client reconnect

4. Practical example

An application using JMS and ActiveMQ moves its broker to Amazon MQ to minimize code changes.

SQS/SNS uses AWS's own API.

But the old app might be using: AMQP · MQTT · STOMP · OpenWire · WSS · JMS

If rewriting to SQS/SNS is too expensive:

Existing Application
↓ keep current protocol
Amazon MQ

→ no need to change the entire messaging code.

Old Java / JMS / ActiveMQ app
↓
Amazon MQ
RabbitMQ app needs
exchange / binding / routing
↓
Amazon MQ
Hybrid app uses
AMQP / MQTT / STOMP
↓
Amazon MQ

5. Comparison

MQ preserves familiar brokers and protocols; SQS and SNS use AWS-native messaging models.

Amazon MQ vs SQS / SNS

Amazon MQ = traditional message broker = protocol compatibility = runs on broker instances

SQS / SNS = AWS-native messaging = serverless / managed scale is better

Legacy app needs AMQP/JMS/MQTT
↓
Amazon MQ
New AWS-native app
↓
SQS/SNS preferred

Amazon MQ does not scale nearly infinitely like SQS/SNS.

You still have to pay attention to: Broker size · Storage · Connections · Throughput · Queue depth

SQS vs SNS vs Kinesis vs Firehose vs MQ

1. Concept

SQS queues jobs, SNS broadcasts notifications, Kinesis retains streams, Firehose delivers data, and MQ provides compatible message brokers.

2. Purpose

Select messaging based on data reception, replay and application compatibility requirements.

3. How it works

Queue another stream

  • SQS workers often share message processing; delete message when finished.
  • Kinesis keeps records in the retention window even after a consumer reads, allowing multiple consumers to read independently or replay.
  • SQS Standard has at-least-once/best-effort order; FIFO uses message group/deduplication to support consistent ordering.
  • Kinesis orders by shard, not a global order across all shards.

SNS + SQS

An event → SNS ┬→ Queue A → order processing
               └→ Queue B → analytics
  • Each system has its own queue, retry and scale.
  • SNS push to queue; worker pulls from SQS.
  • SNS does not have to replace every queue;
  • archive/replay of SNS FIFO is a separate feature, it does not mean every SNS topic is streamed like KDS.

Kinesis + Firehose and MQ

  • KDS keeps the stream for analytics/replay; Firehose pushes a branch to S3/warehouse.
  • As long as managed delivery is needed, you can use Firehose directly without adding KDS.
  • MQ compatible migration app needs JMS/AMQP/MQTT/STOMP or semantics broker engine. engine.
  • Broker has finite capacity and needs to choose HA deployment; new app can be used SQS/SNS as appropriate.

Limit Payload, FIFO Deduplication & SNS → Lambda Resource Policy

ServiceMaximum sizeAnti-infection Mechanism & Authorization
DynamoDB Item400 KB (including attribute names and values; large file saved to S3 + holds S3 key in DynamoDB)Use Conditional Writes when idempotency is needed
SQS Message1 MiB (larger payload using S3 Extended Client)SQS FIFO filter accordingly MessageDeduplicationId or hash the content in the window 5 minutes
SNS Message256 KiB default (supports scaling up to 1 MiB / Extended Client with S3)SNS FIFO filter in 5 minutes just before fan-out to SQS FIFO subscribers; when SNS calls Lambda is required Lambda Resource Policy allow lambda:InvokeFunction with Principal: sns.amazonaws.com attached SourceArn

4. Practical example

Pending orders use SQS; events needed by multiple systems fan out through SNS to several queues.

Background jobs: SQS. One event to many systems: SNS + SQS. Telemetry multiple consumers/replay: KDS. Logs to data lake: Firehose. Legacy broker app needs few code changes: MQ.

5. Comparison

Choose by ordering, replay, fan-out, retention, and protocol compatibility rather than throughput alone.

Key comparison

ServiceModelDifferences
SQSQueue, workers pull/divide workBuffer job, retry/DLQ; message is deleted after processing
SNSPub/sub pushFan-out event to many subscribers; filter each subscription
Kinesis Data StreamsStream has retentionMany consumers read/replay; ordering by shard/partition key
Data FirehoseManaged deliveryBuffer/transform sends to destination, does not replay stream arbitrarily
Amazon MQManaged ActiveMQ/RabbitMQ brokerCompatible with existing protocols and broker applications

ECS, Fargate, ECR & EKS

Amazon ECS – Orchestration, tasks, and services

1. Concept

ECS manages containers according to task definitions and the number of copies you request.

2. Purpose

Deploy containers, maintain the required task count, and replace failed tasks without building orchestration.

3. How it works

  • Amazon ECS is AWS's container orchestration service. You declare the container you need to run, its quantity and resources; ECS takes care of deploying, monitoring and replacing tasks when they fail.
Container Image
↓
ECS
↓
EC2 or Fargate

3 main concepts

ECS conceptNature
Task DefinitionThe blueprint declares the container image, CPU/RAM, ports, environment variables and IAM Roles
TaskAn actual running instance is instantiated from the Task Definition
ServiceThe dispatcher maintains the correct quantity desiredCount Tasks are always running and attached to the Load Balancer

For example:

Service desiredCount = 3
↓
Task 1
Task 2
Task 3
  • A Task dies → ECS creates a new Task to replace it.

ECS Cluster

  • Cluster is Logical group contains Service, Task and compute capacity.
ECS Cluster
├── Service A
│   ├── Task
│   └── Task
└── Service B
    └── Task

Cluster is not a server.

Container flow

ECR Image
↓
Task Definition
↓
ECS Service / Run Task
↓
EC2 or Fargate
↓
Containers run
  • Service Used for apps to run continuously.
  • Run Task Used for jobs that run once.

IAM Roles

These two roles are easy to confuse:

Task Execution Role
= ECS is used to start Task
→ pull image from ECR
→ send CloudWatch Logs
→ get Secret
Task Role
= code inside the usage container
→ read S3
→ call DynamoDB
→ send SQS
  • If you run ECS on EC2, you also have: Container Instance Role = ECS Agent permissions on EC2

Execution Role = ECS used. Task Role = application used.

Load Balancer

  • awsvpc: Each task has its own ENI and SG; Available for EC2 tasks and required for Fargate. EC2 bridge/host mode uses the instance's networking.
  • Service registers task to target group. EC2 bridge mode can use dynamic host port mapping; awsvpc uses target type IP. .
  • ECS Service is usually placed as follows: ALB = HTTP / HTTPS = path / host routing
  • NLB = TCP / UDP = high performance
Client
↓
ALB
├── /users  → User Service
└── /orders → Order Service

Auto Scaling

Scaling mechanism on ECSHow it works
Service Auto ScalingApplication Auto Scaling increases/decreases desiredCount by min/max (Target Tracking by CPU, RAM, ALBRequestCountPerTarget; Step Scaling; Scheduled Scaling)
Cluster Auto Scaling (EC2)Capacity Provider connects ECS Cluster with ASG to automatically add EC2 when Pending Tasks lack space (need to attach capacity provider strategy)
targetCapacitySet 100% to take full advantage of EC2 or lower to leave headroom; ASG still needs a valid min/max
ECS on FargateAWS takes care of the entire underlying compute infrastructure; You only configure Service Auto Scaling for the number of Tasks

Storage

If multiple Tasks need to share the same file:

ECS Tasks
↓
Amazon EFS
↓
Shared Persistent Storage
  • S3: = Object Storage = accessible via SDK/API
  • Not a regular shared filesystem.

ECS Compute Modes, Task Placement Strategies & Scheduled Tasks

ECS Compute modeWho manages the Server?Distinguishing point
ECS on FargateAWS completelyServerless per Task (vCPU/RAM), no EC2 management
ECS Managed InstancesAWS operates EC2AWS takes care of provisioning/patching/scaling EC2 but supports choosing specialized machine models & GPUs
ECS on EC2You manage yourselfFull control over AMI, host OS, Capacity Provider attached to ASG
ECS AnywhereYou (machine outside of AWS)Register server/VM On-premises to ECS Cluster via EXTERNAL launch type
Task Placement Strategy (ECS on EC2)How to arrange TasksTarget
spreadSpread Tasks evenly across Availability Zones or EC2 instancesHigh Availability
binpackTightly place Tasks into the fewest EC2 instances according to CPU or MemoryOptimize costs, easily recover idle machines
randomRandomly select EC2 that meets the resource conditionsSimple allocation without priority
  • ECS Scheduled Task: run the container periodically according to cron/rate using Amazon EventBridge Scheduler call RunTask.

4. Practical example

An API runs three ECS tasks behind an ALB; ECS Service replaces a failed task.

ALB
↓
ECS
↓
Web API / Microservices
SQS
↓
ECS Worker
↓
Background Job
ECS Tasks
↓
EFS
↓
Shared Files

5. Comparison

  • The task role grants application permissions;
  • the execution role supports task startup tasks such as image pulls and logging.

EC2 vs Fargate

ECS + EC2 = EC2 administrator = instance type + patch + ASG + capacity

ECS + Fargate = AWS manages the server = you only choose CPU/RAM for the Task

Remember:

EC2
→ more controls
→ suitable for stable workload / need to optimize cost

Fargate
→ less infrastructure management
→ suitable for fluctuating workloads
ECS Anywhere and External launch type
  • ECS Anywhere Allows registering servers/VMs on-premises or outside of AWS to the ECS cluster to manage containers using ECS.
  • External launch type (EXTERNAL) used to run ECS tasks/services on these external instances; You still manage the server, OS and capacity.
Server/VM outside of AWS
↓ install ECS Agent + SSM Agent, register cluster
ECS Cluster
↓ launch type: EXTERNAL
Container Tasks on servers outside of AWS

For example, container management processes data at the factory from the ECS while the data remains on-premises.

AWS Fargate

1. Concept

Fargate provides container compute without you creating, patching, or managing the underlying EC2 hosts.

2. Purpose

Reduce provisioning, patching, and host operations for container workloads.

3. How it works

  • AWS Fargate is serverless compute for containers — used with ECS or EKS. You declare the CPU/RAM of task/pod; AWS provision, patch and operate the entire platform server.

Container run flow:

Container image + CPU/RAM
↓ ECS Task / EKS Pod
Fargate
↓
AWS operates compute

What is Fargate not?

  • ECS/EKS: Manage containers: which application to run, how many copies, and when to replace a failed container.
  • Fargate: Provides compute for containers without requiring you to manage EC2 hosts.
  • Together: ECS or EKS manages the work; Fargate runs it. Fargate does not replace ECS/EKS.

What does Fargate still need?

  • VPC + Subnet — each task has its own ENI.
  • Security Group — controls traffic in/out of tasks.
  • IAM role — task execution role + task role.
  • Image — from ECR or other registry.
  • Logs — CloudWatch Logs (via execution role).

Fargate + EFS

  • Fargate task can be mounted Amazon EFS to have persistent shared storage for serverless containers — multiple multi-AZ tasks read/write the same file system.

Limits to remember

  • CPU/RAM must be a supported pair. For example, task 4 vCPU uses 8–30 GB of RAM; This is not Fargate's maximum level. .
  • Cannot SSH into the underlying infrastructure.
  • Some workloads need host-level control (eg custom kernel, GPU) → must use EC2 launch type.

Principles for calculating Compute fees on Fargate

  • Fargate only charges for compute vCPU and Memory allocated during the time the Task/Pod actually runs (don't pay for idle EC2); Expanded storage, data transfer and Load Balancer are charged separately.

4. Practical example

A small operations team runs its API with ECS on Fargate, configuring images, CPU/memory, networking, and scaling.

APIs/microservices run on ECS that the team wants to focus on containers, no Manage EC2 nodes. Job on demand: run tasks when there is work; Use EFS if many tasks need it persistent shared files.

5. Comparison

Fargate provides compute for ECS/EKS; ECS and EKS provide orchestration; ECR stores images.

Fargate vs EC2 launch type

CriteriaFargateEC2
Server managementAWS takes care of everythingYou manage
Charge unitCPU/RAM of taskInstance hours
Infrastructure controlLow (no SSH)High (SSH, custom)
Appropriate workloadSmall, irregular, serverlessLarge, stable, cost-optimized
Amazon ECR

1. Concept

ECR stores container images so applications can pull the intended software package to run.

2. Purpose

Version container images and distribute them to runtime systems with access controls.

3. How it works

  • Amazon ECR (Elastic Container Registry) is a private Docker/OCI image registry managed by AWS — where container images for ECS, Fargate, or EKS are stored.

Typical usage flow

CI build image → push ECR (tag/digest) → ECS/EKS pull → container runs

Main point

  • Image tag: A readable name such as :latest, which can point to a different image later. Production should use an immutable tag or sha256 digest to pin the intended image.
  • Pull permissions: The task execution role needs the required ECR actions, including ecr:GetAuthorizationToken and ecr:BatchGetImage. IAM and repository policies control push/pull access, especially across accounts.
  • Connectivity: Valid permissions do not fix a missing network path to ECR; check NAT or suitable VPC endpoints.
  • Image scanning: Finds vulnerabilities in images; choose basic scanning or enhanced scanning with Inspector.
  • Lifecycle policy: Automatically removes older images according to rules, such as keeping only the five newest images, to reduce cost.
  • Replication and encryption: Images can be replicated to another Region/account. Stored data uses AWS-managed encryption keys or the selected KMS key.

Security

ClassMechanism
Control planeIAM (create/edit/delete repository)
Data planeRepository policy + IAM (push/pull)
At restSSE with AWS managed key or KMS CMK
In transitTLS (HTTPS)

4. Practical example

CI builds an image, pushes it to ECR, and deploys ECS Service using that image version.

CI build/push image into ECR; ECS/EKS pulls according to digest to deploy the correct version.

Repository cross-account with IAM/repository policy; Scan for vulnerabilities and use lifecycle policy to clean up old images.

5. Comparison

ECR is a registry, not a container runtime; ECS/EKS manage workloads while Fargate or nodes provide compute.

ECR Basic Scanning vs Enhanced Scanning

ECR scan modeScanning Range & Timing
Basic ScanningScan for basic OS packages vulnerabilities when pushing images or upon manual request
Enhanced ScanningIntegration Amazon Inspector to continuously and automatically scan both OS packages and programming language libraries as soon as new CVEs appear
Amazon EKS

1. Concept

EKS runs Kubernetes on AWS; AWS manages the control plane while you deploy applications through Kubernetes APIs.

2. Purpose

Use Kubernetes APIs and its ecosystem without operating the control plane.

3. How it works

  • Amazon EKS (Elastic Kubernetes Service) is a Kubernetes control plane managed by AWS — for teams that need Kubernetes APIs, ecosystem (Helm, operators), and portability.

Architecture

AWS-managed control plane (API server · etcd · scheduler)
↓
Workload: EC2 node groups or Fargate pods

Three ways to run workloads on EKS

WayDescriptionWhen to use
Managed node groupsAWS manages your ASG+ node (EC2) for youDefault, simplest
Self-managed nodesYou create/manage EC2 nodes yourselfNeeds maximum control
Fargate profilesPod runs on Fargate (serverless)Don't want to manage the node

IAM and Kubernetes RBAC

🧠 IAM access does not automatically grant Kubernetes permissions. IAM allows you to call the EKS API (create cluster, describe…); but the permissions in the cluster (get pods, deploy...) are due Kubernetes RBAC decide. Need to map IAM principal → Kubernetes role.

Fargate + EKS

  • Fargate can be used with EKS Fargate profile (select namespace/label → pod running on Fargate).
  • EKS is still the control plane layer; Workload must be compatible with Fargate capabilities (eg cannot run daemonset on Fargate).

Node groups, networking & persistent storage

EKS Node Management

  • Managed Node Group: AWS manages the EC2 Nodes and Auto Scaling Group (ASG) lifecycle.

  • Self-Managed Nodes: Self-manage EC2 Nodes, suitable when deep customization is needed.

  • Multi-AZ: Distribute Nodes in Private Subnets in multiple AZs to increase HA.

  • ALB/NLB: Allows application access from outside.

  • NAT Gateway / VPC Endpoints: Let Nodes/Pods access the Internet or AWS Services when needed.

EKS Storage

  • Kubernetes uses PVC (PersistentVolumeClaim) to request storage.
Pod → PVC → StorageClass → CSI Driver
                            |
                            v
                      AWS Storage
                      (EBS / EFS / FSx)

Storage

When to use?

EBS

Block Storage, attached to EC2 Node in the same AZ

EFS

Shared File System multi-AZ, multiple Pods can access at the same time

FSx

HPC, high performance or specialized filesystem

EKS Fargate Limitations

  • Does not support EBS Volume: Use EFS if you need Persistent Shared Storage.

  • Does not support DaemonSet: Does not run workloads that require direct management of the host.

  • No need to manage EC2 Nodes: AWS Fargate provides compute.

Kubernetes resources and permissions for Pods

DemandService / conceptFunction
Run Kubernetes on AWSAmazon EKSAWS manages the Kubernetes control plane
Compute runs PodsWorker Nodes (EC2/Fargate)EC2 nodes or serverless Fargate are where the workload actually runs
Maintain 3 Pod replicasDeploymentMaintain desired replicas, create replacement Pods when Pods fail
Stable networking to PodsKubernetes ServiceStable network address even if Pods are replaced or IP changed
Organize Kubernetes resourcesNamespaceGroup Pods, Services, Deployments by team/environment
Identity for Kubernetes PodsService AccountThe identity of the Pod when calling the Kubernetes API; RBAC combination
Non-sensitive configurationConfigMapSave URLs, environment variables, log levels outside the image
Sensitive application dataKubernetes Secret / AWS Secrets ManagerPasswords, API keys, tokens; Secrets Manager supports rotation when configured
Kubernetes API permissionsRBACRegulate who can view/create/edit/delete Kubernetes resources
AWS permissions per Pod + OIDCIRSAService Account ↔ IAM role via IAM OIDC provider + STS; grant temporary credentials
AWS permissions per Pod + EKS AgentEKS Pod IdentityService Account ↔ IAM role via Pod Identity Agent + EKS Auth; No need for IAM OIDC provider
IAM permissions for EC2 worker nodeEC2 Instance ProfileAttach the IAM role node to the EC2 worker node's AWS tasks

Demand

Select

AWS Service needs permission to manage resources for you

Service-Linked Role

EKS Pods need AWS permissions, using OIDC

IRSA

EKS Pods require AWS permissions, simple configuration, do not use OIDC Provider

EKS Pod Identity

EKS runs Pods on Fargate, requiring its own IAM Role

IRSA

ECS Application needs to access S3

ECS Task Role

  • RBAC authorization in Kubernetes; The IAM role grants permissions to AWS. Node roles do not replace individual Pod rights. Restrict Pod access to IMDS to avoid obtaining node credentials.
  • EKS Pod Identity Pods supported on Linux EC2 nodes, Fargate not supported; Fargate Pods can use IRSA. Base64 in a Kubernetes Secret is not encryption; Still need to control access and avoid putting secrets in image/Git. ·

Two flows grant the IAM role to the Pod

IRSA — OIDC + STS
Pod uses Kubernetes Service Account
↓ SA annotation: eks.amazonaws.com/role-arn
Kubernetes issues projected OIDC Token to Pod
↓ AWS SDK in Pod calls AssumeRoleWithWebIdentity
AWS STS
├── Authenticate OIDC Token via IAM OIDC provider
└── Check IAM Role Trust Policy (issuer, sub, audit)
↓
STS returns Temporary Credentials to Pod
↓
Pod calls S3/DynamoDB according to IAM Permission Policy
  • Configuration: IAM OIDC provider for cluster + IAM role with Trust/Permission Policy + Service Account annotation. Trust policy properly limits namespace/Service Account; Use the AWS SDK that supports IRSA.
EKS Pod Identity — Agent + EKS Auth
Pod A uses Service Account: training-sa, namespace: ml
↓
Kubernetes grants projected Pod Identity Token (JWT)
↓ AWS SDK sends token to Agent on node
Pod Identity Agent
↓ EKS Auth: AssumeRoleForPodIdentity
EKS Auth API
├── Token authentication
├── Check Pod Identity Association
└── Map cluster + ml + training-sa → S3ReadRole
↓ EKS calls STS AssumeRole; The role trust policy must allow it
Temporary Credentials
↓ EKS Auth → Agent → Pod
Pod calls S3 according to IAM Permission Policy
  • Configuration: Pod Identity Agent (or integrated EKS Auto Mode) + association between cluster/namespace/Service Account and IAM role. Role trust pods.eks.amazonaws.com with sts:AssumeRole, sts:TagSession; node role needed eks-auth:AssumeRoleForPodIdentity. Use an SDK that supports container credential providers.
CriteriaIRSAEKS Pod Identity
Role linkService Account annotationPod Identity Association
AuthenticationIAM OIDC provider + STSAgent + EKS Auth; No need for IAM OIDC provider
STSPod SDK calls AssumeRoleWithWebIdentityEKS calls AssumeRole
CredentialsSTS → PodEKS Auth → Agent → Pod
  • Trust policy decides Who gets to assume the role?; permission policy decides What can roles do?. ·

Five EKS Compute modes, Autoscaling Streams & Three easily confused Endpoints

EKS Scaling/Compute componentExact role
Kubernetes Metrics ServerCollect actual CPU/RAM of Pods/Nodes assigned to HPA (do not create/delete Pods yourself)
HPA vs VPAHorizontal Pod Autoscaler (HPA) increase/decrease number of Pods; Vertical Pod Autoscaler (VPA) Adjust CPU/RAM requests of each Pod
Cluster Autoscaler vs KarpenterCluster Autoscaler increases/decreases nodes via ASG; Karpenter Direct allocation of EC2 optimizes Pending Pods configuration without being tied to a fixed ASG
EKS Auto ModeAWS automatically manages compute, autoscaling, networking, and core add-ons
Load increases → Metrics Server → HPA increases the number of Pods → Lack of space (Pending Pods) → Karpenter / Cluster Autoscaler adds EC2 Nodes
The three Endpoints around EKS are easy to confuseFunction
EKS Interface VPC EndpointCall the AWS EKS Management API (eg DescribeCluster) qua PrivateLink
Kubernetes Private API Endpoint / Kubernetes Public API EndpointWorker Nodes & kubectl communicate with Control Plane (turn on Private Endpoint for pure internal connection; if only enable Kubernetes Public API Endpoint, the private node needs NAT Gateway to join)
ECR Interface Endpoints + S3 Gateway EndpointWorker Nodes in private subnets without the Internet can still pull container images and image layers from S3

4. Practical example

A team using Helm and Kubernetes operators chooses EKS to retain its tools and deployment workflows.

The team already has Kubernetes manifests/Helm charts and needs to keep the Kubernetes API/tooling when moving to AWS.

Stateful pods on EC2 nodes using EBS; multiple pods sharing files or Fargate pods using EFS when appropriate.

5. Comparison

EKS uses Kubernetes; ECS uses AWS orchestration models; choosing orchestration is separate from choosing compute nodes.

EKS vs ECS

CriteriaEKSECS
PlatformKubernetes (open-source, portable)AWS-native, proprietary
ComplexityHigher (learn Kubernetes)Lower, easy to start
EcosystemHelm, operators, tooling K8sLimited to AWS
PortabilityCan run on-prem / other cloudsMainly AWS; ECS Anywhere supports on-premises
When to chooseStandardized K8s, need portabilityWant simple AWS-native

run tasks on external instances; Kubernetes is still the choice when needing the Kubernetes ecosystem.

Serverless Overview

AWS Lambda

1. Concept

Lambda runs your code in response to events without you managing the servers that execute it.

2. Purpose

Execute event-driven logic without maintaining an always-on function server.

3. How it works

  • AWS Lambda is used to run code based on events without needing to manage the server.
Event
↓
Lambda
↓
Run Code
↓
Result / Action
  • AWS takes care of itself: Server · Scaling · Runtime infrastructure
  • You mainly worry about: Code · Memory · Timeout · Permissions · Concurrency

Lambda = serverless compute for short-term, event-driven workloads.

Important limits

  • Memory: 128 MB → 10 GB
  • Increasing memory also increases: CPU · Network
  • Timeout: Max execution = 15 minutes
  • Temporary storage: /tmp: 512 MB → 10 GB = temporary / ephemeral

Do not use /tmp to save data long term.

  • Environment variables: Total size · ≈ 4 KB

Lambda Package

  • There are 2 popular ways: ZIP · or · Container Image
1. ZIP
  • Suitable for small application/dependency.
Code + Dependencies
↓
ZIP
↓
Lambda
2. Container Image
Container Image
↓
Lambda Runtime API compatible
↓
Lambda

Lambda containers are not places to run arbitrary Docker. If you need a long-running container or more runtime control → ECS/Fargate is often more suitable.

Event-driven

  • Lambdas are often triggered by: API Gateway · S3 · SQS · EventBridge · DynamoDB Streams · SNS

For example:

S3 Upload
↓
Lambda
↓
Create Thumbnail

Or:

API Gateway
↓
Lambda
↓
Business Logic
↓
Response

Pricing Model

  • Lambda mainly charges according to: Number of Requests + Compute Duration
  • Compute dependencies: Memory · × · Execution Time

Points to remember:

Higher memory
→ More powerful CPU
→ function can run faster
  • Should have the lowest memory not always the cheapest.

Concurrency

  • Concurrency = number of Lambda invocations running at the same time.
50 requests/second

Each request runs 2 seconds
↓
≈ 100 concurrent executions
  • Not: Concurrency ≠ total number of requests

Reserved Concurrency

  • Reserved concurrency: Reserves part of the account's concurrent execution allowance for a function and also caps that function's concurrent executions.
  • Example: A setting of 100 allows up to 100 invocations at once, not 100 requests per second.
  • Purpose: Prevents a function from exhausting account concurrency or overwhelming a downstream database.
  • Comparison: Reserving concurrency does not pre-initialize execution environments; provisioned concurrency does that.
Lambda
↓
RDS
1000 Lambdas
↓
1000 DB Connections
↓
RDS overload

Throttling

When concurrency runs out:

Request
↓
Lambda
↓
No available concurrency
↓
Throttle

With synchronous invocation:

Throttle
→ error / HTTP 429

With async invocation:

Throttle / Failure
↓
Retry
↓
DLQ / Destination if configured
  • Important metrics: Throttles

Cold Start

  • Cold Start = Lambda must create a new execution environment before running the code.
Request
↓
There is no warm environment
↓
Load Code
↓
Start Runtime
↓
Init Code
↓
Handler
  • → The first request may be slower.

When the environment is still warm:

Request
↓
Existing Environment
↓
Handler
  • → faster.

Reduce Cold Start

There are 2 main concepts:

1. Provisioned Concurrency
  • AWS keeps the initialized Lambda environment available.
Provisioned Environment
↓
Request
↓
Run now
  • Suitable: API needs stable latency · Predictable traffic
2. SnapStart

Idea:

Initialize Function
↓
Snapshot State
↓
New request
↓
Restore Snapshots
  • → reduces initialization time for supported runtimes.
  • Remember: Provisioned Concurrency = keep the environment warm
  • SnapStart = restore from inited snapshot

CloudWatch Monitoring

  • Lambda integrates itself with CloudWatch.
  • Follow: Invocations · Duration · Errors · Throttles · Logs
Lambda
↓
CloudWatch Metrics + Logs
↓
Dashboard / Alarm
Errors > 5
↓
CloudWatch Alarm
↓
SNS

Default Lambda and VPC

  • By default, Lambda runs in a network managed by AWS.
Lambda
↓
Internet / AWS Public APIs

But you cannot access private resources in your VPC:

  • Private RDS · Private ElastiCache · Internal Load Balancer

Lambda into VPC

If you need to access private RDS:

Lambda
↓
Attach VPC
↓
Subnets + Security Group
↓
ENI
↓
RDS
  • ENI = virtual network interface that Lambda uses to connect to the VPC.
Lambda
↓
ENI + Lambda Security Group
↓
Private Subnet
↓
RDS Security Group
↓
RDS
  • RDS SG should allow: Source = Lambda Security Group
  • instead of opening the CIDR wide.

Lambda in VPC wants to go to the Internet

Khi Lambda attach VPC:

Lambda
↓
Private Subnet
  • it does not have its own public IP.

If Internet is needed:

Lambda
↓
Private Subnet
↓
NAT Gateway
↓
Internet Gateway
↓
Internet

If you only need AWS services:

Lambda
↓
VPC Endpoint
↓
AWS Service
  • → keep traffic private when the service supports it.

Lambda + RDS

Common problem:

Traffic increased
↓
Strong lambda scale
↓
multiple DB Connections
↓
RDS overload

Solution:

Lambda
↓
RDS Proxy
↓
RDS / Aurora

RDS Proxy

  • RDS Proxy = connection pool between Lambda and RDS/Aurora.
Lambda 1 ─┐
Lambda 2 ─┼→ RDS Proxy → RDS
Lambda 3 ─┘

Instead:

Lambda 1 → DB Connection
Lambda 2 → DB Connection
Lambda 3 → DB Connection
...
  • Proxies help: Reuse connections · Reduce connection storm · Support failover · Better credential management

Flow Lambda + Private RDS

Lambda
↓
VPC
↓
ENI
↓
RDS Proxy
↓
RDS / Aurora

If Lambda still needs Internet:

Lambda
↓
Private Subnet
↓
NAT Gateway
↓
Internet

Lambda Layers, SnapStart, Runtime, Memory–CPU Ratio & Hyperplane ENI

Lambda featureThe core point needs to be distinguished
Lambda LayersReuse common libraries/code between multiple functions; each Layer version is immutable — publishing a new version does not automatically change the function pointing to the old version (large data hundreds of MB–GB read/write at runtime, use EFS)
Lambda SnapStartTake a snapshot of the initialized environment to drastically reduce cold starts; only works on published versions (not applicable to $LATEST)
Runtime & Container ImageSupports any language via Custom Runtime and Linux container images up to 10 GB (Windows containers not supported)
Memory ↔ CPU ratioIncreasing RAM will automatically increase CPU scaling and network bandwidth (~1.769 MB equivalent to 1 vCPU; max 10.240 MB ≈ 6 vCPUs; separate from /tmp and 4 KB environment variable limit)
VPC Configuration (Hyperplane ENI)Only turn on when calling private IP (RDS, ElastiCache, Internal EC2, Cross-VPC RDS Proxy); Does not need to be enabled when calling public AWS APIs such as S3/SQS/DynamoDB. Lambda and EC2 and VPC are not required to be in the same subnet

4. Practical example

A new S3 image triggers Lambda to create a thumbnail and save it to a different prefix.

S3 Upload
↓
Lambda
↓
Thumbnail / Metadata
API Gateway
↓
Lambda
↓
Serverless API
SQS
↓
Lambda
↓
Background Processing
EventBridge
↓
Lambda
↓
Scheduled / Event Automation
API Gateway
↓
Lambda
↓
RDS Proxy
↓
Aurora

5. Comparison

  • Lambda suits time-bounded event processing;
  • ECS/Fargate suit long-running containers or different runtime requirements.

Lambda vs ECS/Fargate

Lambda = event-driven = short workload = max 15 minutes = self-scaling invocation

ECS / Fargate = container workload = long runs = more runtime control

Resize image
→ Lambda
Backend containers run 24/7
→ ECS / Fargate
Amazon DynamoDB

1. Concept

DynamoDB stores NoSQL key-value or document data on AWS-managed infrastructure, without you operating database servers.

2. Purpose

Serve key-based data access at scale with low infrastructure administration effort.

3. How it works

  • Amazon DynamoDB is a serverless NoSQL database with low latency, self-scaling and no need for server management.
  • DynamoDB = NoSQL = Serverless = Key-value / Document = Millisecond latency
  • Suitable for: User Profile · Shopping Cart · Session · Game Data · IoT Metadata · Serverless API

DynamoDB is strong when it knows access patterns in advance and accesses by key.

Table / Item / Attribute

  • Table = data table
  • Item = a record
  • Attribute = field of record

For example:

Users Table

Item:
{
  UserId: 123,
  Name: "Trong",
  Age: 25
}

Besides the Primary Key, the schema is quite flexible:

Item A
→ Name + Age

Item B
→ Name + Country + Email

Primary Key

  • Primary Key: The key that uniquely identifies an item, chosen when the table is created.
  • Partition Key only: Each key value identifies one item, such as UserId = 123.
  • Partition Key + Sort Key: The pair identifies one item. For example, UserId = 123 and GameId = 1 identifies that user's score in game 1.
  • Memory aid: The partition key groups items; the sort key distinguishes items in that group. One user can have several games with different GameId values.

Item Size

  • Max Item Size = 400 KB
  • Item may contain: String · Number · Boolean · Binary · Null · List · Map · String / Number / Binary Set

Capacity Mode

  • Provisioned: Specify read capacity units (RCUs) and write capacity units (WCUs); suited to predictable demand and can use Auto Scaling.
  • On-Demand: Pay for requests used; suited to unpredictable demand or spikes.
  • Choosing: Use provisioned capacity for direct control over allocated capacity; consider on-demand when reducing advance capacity planning is more important.
Traffic increased
↓
DynamoDB scales itself

Traffic decreased
↓
scale down

DAX

  • DAX = in-memory cache specific to DynamoDB.
Application
↓
DAX
↓
DynamoDB

If cache hits:

Application
↓
DAX
↓
Results are very fast

If cache miss:

DAX
↓
DynamoDB
↓
get data
↓
cache again
  • DAX can reduce read latency to microseconds.

DynamoDB Streams

  • Streams = records item changes.
INSERT
MODIFY
DELETE
↓
DynamoDB Streams

Popular flows:

DynamoDB
↓
Streams
↓
Lambda
↓
Action
User Created
↓
DynamoDB Streams
↓
Lambda
↓
Send Welcome Email

Streams keep change records between:

24 hours

Streams = change feed, not backup.

DynamoDB + Kinesis Data Streams

If you need a stronger stream:

DynamoDB
↓
Kinesis Data Streams
↓
Firehose / Lambda / Analytics
↓
S3 / Redshift / OpenSearch
  • Suitable when needed: More consumers · Longer retention · Analytics pipeline

Global Tables

  • Global Tables = DynamoDB multi-Region active-active.
  • US Region · ↕ · EU Region · ↕ · Asia Region
  • Applications can: Read + Write · in Region near the user
  • Data is replicated between Regions.
  • Global Application · Low Latency · Multi-Region DR

Streams = broadcast change events to consumers. Global Tables = replicate table between Regions.

TTL

  • TTL = automatically delete item when expired.
  • Item has attributes: expiresAt = epoch timestamp
Session
↓
TTL expired
↓
DynamoDB deletes itself
  • Session · Token · Temporary Data · Old Events

TTL runs in the background, not guaranteed to be deleted exactly at the second of expiration.

Backup

1. Point-in-Time Recovery (PITR)
Continuous Backup
↓
Restore to a previous time
  • According to the slides: Recovery Window = 35 days
10:00 data is correct
11:00 User mistakenly deleted
↓
Restore to 10:00
  • Restore creation: New DynamoDB Table
2. On-Demand Backup
Create Backup
↓
keep until you delete
  • Long-term Backup · Audit · Compliance · DR

Export to S3

DynamoDB
↓
Export
↓
S3
  • Athena Analytics · Audit · ETL · Archive
  • There is no need to consume the read capacity of the table.

Import from S3

S3
↓
Import
↓
New DynamoDB Table
  • You can import formats like: CSV · DynamoDB JSON · ION
  • Import always creates new table.

Popular flow

API Gateway
↓
Lambda
↓
DynamoDB

Can add:

DynamoDB
↓
Streams
↓
Lambda
↓
SNS / OpenSearch / S3

Or:

Application
↓
DAX
↓
DynamoDB

4. Practical example

A shopping-cart application retrieves carts by user ID and uses TTL to remove expired data asynchronously.

Serverless API
↓
Lambda
↓
DynamoDB
Shopping Cart
↓
DynamoDB
↓
TTL automatically deletes old data
DynamoDB
↓
Streams
↓
Lambda
↓
Notification
Global App
↓
Global Tables
↓
US / EU / Asia

5. Comparison

DynamoDB design starts with access patterns and keys; RDS suits relations, joins, and flexible SQL queries.

DAX vs ElastiCache

DAX = DynamoDB cache = DynamoDB API compatible

ElastiCache = general cache = Redis / Valkey / Memcached

DynamoDB reads too much
→ DAX

Cache sessions / aggregates / custom objects
→ ElastiCache

DynamoDB vs RDS

DynamoDB = NoSQL = key-based access = large scale = flexible schema

RDS / Aurora = SQL = relational = joins = complex transactions/business data

Shopping Cart / Session
→ DynamoDB
Order + Customer + Payment
need join/relationship
→ RDS / Aurora

DynamoDB Deletion Protection vs TTL

DynamoDB FeaturesPurpose & Mechanism of action
Deletion ProtectionPrevent accidental deletion of entire DynamoDB tables at the admin level
TTL (Time to Live)Automatically asynchronously purge overdue items based on the epoch timestamp attribute (free WCU at original table, may charge for replication at Global Tables)
Amazon API Gateway

1. Concept

API Gateway receives application API requests and forwards them to the configured backend.

2. Purpose

Expose APIs to clients with appropriate routing, authorization, and traffic management.

3. How it works

  • Amazon API Gateway is a managed service that exposes APIs to clients and sits between the client and the backend.
Client
↓
API Gateway
↓
Lambda / HTTP Backend / AWS Service
  • API Gateway takes care of common parts such as: Authentication · Authorization · Throttling · Validation · Caching · Routing · Stages / Versions

API Gateway = API gateway.

API Types

  • API Gateway supports: REST API · HTTP API · WebSocket API

For example:

Mobile App
↓
REST / HTTP API
↓
Lambda

WebSocket is used when real-time two-way connection is needed:

  • Client · ↕ · WebSocket API · ↕ · Backend

Stage & Version

  • Environment can be divided: dev · test · prod
  • /dev/orders · /test/orders · /prod/orders
  • Version API: v1 · v2
  • → Helps deploy new version without destroying old client.

Throttling / API Key

API Gateway can limit requests:

Client
↓
API Gateway
↓
Rate Limit
↓
Backend
  • 100 requests / second
  • If exceeded: Throttle
  • Can be used: API Key + Usage Plan; to limit by client.

Validation & Transform

  • API Gateway can validate requests before sending them to the backend.
POST /users

body:
{
  "email": ...
}

If fields are missing:

API Gateway
↓
Reject
  • no need to call Lambda.
  • You can also transform: Request · Response
  • before/after backend.

API Caching

  • API Gateway can cache responses.
Client
↓
API Gateway Cache
↓
Response
  • If cache hits: no need to call backend
  • → reduce: Latency · Backend Load · Cost
  • Suitable for GET/read data with little change.
  • Do not use cache to cover writes or constantly changing data.

Integration Types

1. Lambda Integration
Client
↓
API Gateway
↓
Lambda
↓
Business Logic
  • This is a popular serverless pattern.
2. HTTP Integration

API Gateway can call existing HTTP backends:

Client
↓
API Gateway
↓
ALB / HTTP API / On-prem
  • Use when you want to add: Auth · Rate Limit · API Key · Caching
  • before the current backend.
3. AWS Service Integration
  • API Gateway can directly call AWS service.
Client
↓
API Gateway
↓
SQS

Or:

Client
↓
API Gateway
↓
Step Functions
  • → sometimes there is no need for an intermediary Lambda.
4. VPC Link and Cloud Map
  • VPC Link is the connection for API Gateway to call the private backend in VPC; The backend does not need a public IP.
Client
↓
API Gateway
↓ VPC Link
Internal ALB / NLB
↓
Private backend
  • With HTTP API, can be integrated via AWS Cloud Map: API Gateway uses service discovery to find the IP and port of the registered backend, Load Balancer is not required.
HTTP API Gateway
↓ VPC Link + Cloud Map discovery
IP:port of healthy service instances
↓
Private backend / ECS service
  • Private integration describes the API → backend path; Private API endpoint Describes the client → API path. APIs with private backends can still be called by clients via a public endpoint.

Event Ingestion Example

Client
↓
API Gateway
↓
Kinesis Data Streams
↓
Firehose
↓
S3
  • Suitable for: Logs · Telemetry · Clickstream · Events

Endpoint Types

1. Edge-Optimized
Global Client
↓
CloudFront Edge
↓
API Gateway
  • Suitable for global clients.
2. Regional
Client
↓
Regional API Gateway
  • Suitable when the client/backend is concentrated in a Region.
  • You can manually add CloudFront in front if you want.
3. Private
VPC
↓
Interface VPC Endpoint
↓
Private API Gateway
  • Only access from private network/VPC is allowed.

Security

  • Common auth types: IAM = internal AWS application
  • Cognito User Pool = mobile / web users
  • Custom Authorizer = custom auth logic

Flow example:

User Login
↓
Cognito
↓
JWT Token
↓
API Gateway
↓
Lambda
Resource Policy for REST API
  • Resource Policy attaches directly to the REST API to control who gets to call the API (execute-api:Invoke), for example by AWS account/principal, source IP, VPC or VPC endpoint.
AWS Console
↓
API Gateway → REST APIs → Select API → Resource policy
  • Policy coordinates with the method's authorization mechanism; Explicit Deny still beats Allow.
  • After editing the policy, redeploy the REST API for the changes to take effect.

Custom Domain

You can use your own domain:

api.example.com
↓
API Gateway
  • Need: ACM Certificate + Route 53

Endpoint edge-optimized:

Certificate
→ us-east-1

Regional endpoint:

Certificate
→ same Region as API

OpenAPI / Swagger

API definitions can be imported:

OpenAPI / Swagger
↓
API Gateway
  • → quickly create routes, methods and models.

Usage Plan, Canary Release, ACM Region & Cloud Map

Mechanism on API GatewayDesign rules
Usage Plan + API KeyLimit Rate, Burst and Quota according to each client on REST API (exceeds payment threshold HTTP 429); API Key specifies the package identifier, Do not use in place of authentication/authorization IAM or Cognito
Canary Release (REST API Stage)Split a small percentage of traffic (eg 10%) to the new version for testing before promoting to 100%
ACM Certificate by EndpointRegional / HTTP API Use ACM certification same Region; Edge-Optimized REST API Using CloudFront managed by AWS, ACM certification is required us-east-1
Private IntegrationVPC Link backend connection in VPC; private HTTP API Supports direct integration with AWS Cloud Map to discover the service IP/port without forcing a Load Balancer

4. Practical example

A mobile application calls API Gateway; an authorizer validates its token before Lambda processes the order.

Mobile App
↓
Cognito
↓
API Gateway
↓
Lambda
Public Client
↓
API Gateway
↓
Internal ALB
Telemetry
↓
API Gateway
↓
Kinesis
↓
Firehose
↓
S3

5. Comparison

API keys and usage plans manage usage, not authorization; REST, HTTP, and WebSocket APIs have different features.

AWS Step Functions

1. Concept

Step Functions coordinates services through steps, branches, and error-handling paths.

2. Purpose

Coordinate multiple processing steps with clear status, retry, and error handling.

3. How it works

State machine

  • Workflow includes states such as Task, Choice, Parallel, Map, Wait, Succeed and Fail.
  • Tasks can call Lambda or AWS service integrations, not just connect Lambda to Lambda.
Receive order → validate → inventory/payment → Choice
                                        ├─ success → delivery
                                        └─ error → compensation processing / failure reporting

Retry, Catch and side effects

  • Retry: Automatically tries a step again after a temporary error, such as a busy service.
  • Catch: Routes execution to an error-handling step when work fails; set timeouts to avoid waiting indefinitely.
  • Avoid duplicates: A payment step may run again after a retry. Use a transaction ID to recognize completed requests and avoid charging twice; this is idempotency.
  • Undoing changes: A workflow does not automatically reverse external changes. If an order fails after reserving funds, add a step to refund or release them.

Standard and Express

TypeSuitable
StandardWorkflow is long, needs history/audit; Maximum one year, job/callback support according to integration
ExpressHigh event rate, short tasks; Maximum 5 minutes, mainly request-response
  • Standard uses exactly-once workflow execution according to the service model, but Retry can still call the task again.
  • Asynchronous Express = at-least-once; Synchronous Express is at-most-once.
  • Don't understand execution guarantees as side effect guarantees that never overlap. AWS workflow types.

Human approval

  • Standard workflow can wait for callback/task token for approval or external job.
  • The system sends success/failure results in tokens with appropriate permissions;
  • set timeout and branch when there is no response.
  • The state machine role needs permission to call services; The task's network/permission must still be correct.

4. Practical example

An order passes inventory, payment, and shipping steps; payment failure routes to compensation handling.

Order fulfillment with multiple steps, data processing with parallel/Map, workflow requires human approval. A simple short task that doesn't require additional Step Functions; A multi-state/retry sequence is appropriate.

5. Comparison

Lambda executes code; Step Functions orchestrates state and step order; SQS holds pending work.

Amazon Cognito

1. Concept

Cognito provides application user registration and sign-in, with support for external identity providers.

2. Purpose

Add registration, sign-in, and resource access for application users.

3. How it works

  • Amazon Cognito is used to manage identity for users of web/mobile apps.
User Pool
= login user
= pay JWT tokens

Identity Pool
= change identity/token
→ temporary AWS credentials

User Pool = Authentication Identity Pool = AWS Access

Cognito User Pool

  • User Pool is user directory for application.
  • Support: Sign up / Sign in · Username / Email / Password · Password Reset · Email / Phone Verification · MFA · Social Login · SAML
User
↓
Cognito User Pool
↓
Login successful
↓
JWT Token

The token can then be used to call the API:

Client
↓ JWT
API Gateway
↓
Validate Token
↓
Lambda / Backend

When is User Pool used?

  • For example, a web app needs: Register · Login · Forgot Password · MFA · Google Login
  • → use: Cognito User Pool

User Pool = "Who are you?"

Cognito Identity Pool

  • Cognito Identity Pool: Exchanges an authenticated identity for temporary AWS access credentials used by the application.
  • Example: A user signs in through a User Pool or Google; the app obtains temporary credentials to upload a file to S3.
  • Authorization: IAM roles and policies define which resources the app may access. Signing in does not grant access to every AWS service.
User Login
↓
User Pool / Google / Facebook / SAML
↓
Token
↓
Identity Pool
↓
Temporary AWS Credentials
↓
S3 / DynamoDB / AWS Service

Why do we need Identity Pool?

  • For example, mobile app needs to upload directly to private S3.

Shouldn't:

Mobile App
↓
Hard-code AWS Access Key ❌

Should:

User Login
↓
Identity Pool
↓
Temporary Credentials
↓
Private S3

No need to embed permanent AWS access key into the app.

DynamoDB Fine-Grained Access

  • Identity Pool can combine IAM so that each user only reads their own data.
User A
→ only read UserA data

UserB
→ only read UserB data
  • Can be used: dynamodb:LeadingKeys
  • with identity ID to limit the partition key.
User A
↓
Temporary Credentials
↓
DynamoDB
↓
only item has User A's Partition Key

Cognito does not replace IAM

  • Cognito = end users of application
  • IAM = AWS users / roles / services / administrators
Customer logs into the mobile app
→ Cognito
Developer manages AWS account
→ IAM

Cognito Adaptive Authentication (Risk-Based)

User login → Cognito Risk-Based Adaptive Authentication scores risk (IP, geolocation, device, history)
  ├─ Low Risk → Allows normal login
  └─ High Risk → Automatically force MFA authentication or block access

4. Practical example

Customers sign in through a user pool and call APIs with JWTs; an identity pool can provide temporary credentials for S3 access.

Mobile App
↓
Cognito User Pool
↓
Login + MFA
↓
API Gateway
↓
Lambda
Mobile App
↓
Identity Pool
↓
Temporary Credentials
↓
S3 Upload
Multi-user App
↓
Identity Pool
↓
DynamoDB
↓
Each user only reads his or her own data

5. Comparison

User pools issue authentication tokens; identity pools provide AWS credentials; Identity Center serves workforce SSO.

Authenticated vs Guest

Identity Pool can grant different roles:

Authenticated User
→ IAM Role A
Guest / Unauthenticated User
→ IAM Role B

For example:

Logged-in User
→ Read + Write S3

Guest
→ Read only

User Pool vs Identity Pool

User Pool = login user = JWT token

Identity Pool = temporary AWS credential = direct access AWS services

User
↓
User Pool
↓
JWT
↓
API Gateway

Other than:

User
↓
User Pool
↓ JWT
Identity Pool
↓
Temporary IAM Credentials
↓
S3 / DynamoDB
CloudFront Functions & Lambda@Edge

1. Concept

CloudFront Functions and Lambda@Edge run code at CloudFront request and response processing stages.

2. Purpose

Perform suitable logic at the edge to reduce unnecessary origin requests.

3. How it works

  • Both are used to run logic right near the user at the CloudFront edge location before/after the request goes to the origin.
  • CloudFront Functions = logic is very light, very fast
  • Lambda@Edge = stronger, more flexible logic

CloudFront Functions = lightweight Lambda@Edge = powerful edge logic

Flow CloudFront

Viewer
↓
Viewer Request
↓
CloudFront Cache
↓
Origin Request
↓
Origin
↓
Origin Response
↓
Viewer Response
↓
Viewer
  • CloudFront Functions only runs in: Viewer Request · Viewer Response
  • Lambda@Edge can be run in: Viewer Request · Origin Request · Origin Response · Viewer Response

CloudFront Functions

  • CloudFront Functions used JavaScript for extremely lightweight logic.
  • Suitable: Rewrite URL · Redirect · Modify Headers · Modify Cookies · Normalize Query String · Lightweight Auth Check

For example:

/old-page
↓
CloudFront Function
↓
Redirect
↓
/new-page

Or:

?utm_source=abc
↓
Normalize
↓
Cache Key
  • → helps increase cache hits.

Lambda@Edge

  • Lambda@Edge uses Lambda code deployed to CloudFront edge.
CloudFront
↓
Lambda@Edge
↓
Complex Edge Logic
  • Can be used: Node.js · Python

Code is generated at:

us-east-1
↓
CloudFront replicate
↓
Edge Locations

Where is Lambda@Edge stronger?

Can do things CloudFront Functions can't do:

  • Network access · Request body · Filesystem · Dependencies · More complex logic
Viewer Request
↓
Lambda@Edge
↓
Call external service
↓
Validate token
↓
Continue / Reject
Request
↓
Lambda@Edge
↓
Choose Origin
↓
US Origin / EU Origin

For example, select service

1. Redirect URL
/old
→ /new
  • → use: CloudFront Functions
2. Add security headers
  • Content-Security-Policy · X-Frame-Options

→ commonly used:

3. Choose origin according to request
US User
→ US Origin

EU User
→ EU Origin

Lambda@Edge

4. Call external API to verify
Request
↓
Edge Function
↓
External API
  • → need: CloudFront Functions does not have network access.

Do not change the Backend

  • Edge functions should not be used for: Database Transaction · Long-running Business Logic · Heavy Processing · Stateful Workflow · Container Workload
  • Those things should still be: Lambda · ECS · Backend Application

4. Practical example

A website normalizes uppercase URLs at the edge before looking up cached content.

Use when logical: Very fast · No need for network calls · No need for filesystem · No need for request body · No need for large dependencies

Suitable for very large request volume and simple logic.

Viewer
↓
CloudFront Function
↓
Normalize URL
↓
CloudFront Cache
Viewer
↓
Lambda@Edge
↓
Choose Origin
↓
Regional Backend
CloudFront Response
↓
Function
↓
Add Security Headers
↓
Viewer

5. Comparison

  • Functions suit lightweight viewer logic;
  • Lambda@Edge supports more processing points and capabilities with different limits.

Viewer vs Origin Events

1. Viewer Request
User sends request
↓
CloudFront receives
↓
Viewer Request Function

Used for: Rewrite URL · Redirect · Check Header · Normalize Cache Key

2. Origin Request

Lambda@Edge only.

Cache Miss
↓
CloudFront
↓
Origin Request
↓
Origin

Change Origin · Add Auth Header · Complex Request Logic

3. Origin Response
Origin
↓
Response
↓
Lambda@Edge
↓
CloudFront

Used to adjust: Error Response · Headers · Response Logic

4. Viewer Response
CloudFront
↓
Viewer Response
↓
User

Add Security Headers · Modify Cookies · Modify Response Headers

CloudFront Functions vs Lambda@Edge

CloudFront Functions = JavaScript = very fast = lightweight logic = Viewer Request / Response

Lambda@Edge = Node.js / Python = more powerful = has network / body / filesystem = Viewer + Origin events

AWS AppSync

1. Concept

AppSync provides GraphQL APIs that connect applications to data sources and real-time updates.

2. Purpose

Build a completely serverless GraphQL API and real-time update channel (Pub/Sub WebSockets), combining multiple data sources in a single query.

3. How it works

Core characteristics

  • AWS AppSync: managed GraphQL & Pub/Sub API services allow clients to retrieve only the necessary data fields from DynamoDB, Aurora/RDS, OpenSearch, Lambda or HTTP APIs through a single endpoint.

4. Practical example

An order screen queries customer and order data through GraphQL and receives status updates through a subscription.

5. Comparison

AppSync focuses on GraphQL and real-time data; API Gateway provides configured REST, HTTP, or WebSocket APIs.

Compare AWS AppSync vs Amazon API Gateway

CriteriaAWS AppSyncAmazon API Gateway
Primary communication modelGraphQL & Real-time Pub/Sub Subscriptions (Pre-managed WebSockets)REST API, HTTP API and the general WebSocket API
Merge multi-source dataResolvers collect data from multiple tables/services in one request, avoiding over-fetchingOften a composite Lambda/backend layer is needed or the client has to call multiple REST endpoints
Authentication supportAPI Key, IAM, Cognito User Pools, OIDC and Lambda AuthorizerIAM, Cognito User Pools, Lambda Authorizer, Mutual TLS

Data & Analytics

Amazon Athena

1. Concept

Athena queries data with SQL, commonly reading files directly in S3, without you setting up query servers.

2. Purpose

Analyze data with SQL without loading everything into a database or managing query servers.

3. How it works

  • Amazon Athena is a serverless SQL query service to analyze data primarily located in Amazon S3 without needing to build a database/data warehouse server.
  • Athena = SQL + S3 + Serverless
The file is in S3
↓
Athena
↓
SELECT ... FROM ...
↓
Results

Athena = runs SQL directly on data in S3.

Basic Flow

Producer
↓
S3
↓
Glue Data Catalog
↓
Athena
↓
SQL Query
↓
Query Result
↓
S3
↓
QuickSight / Application
  • In which: S3 = contains real data
  • Glue Data Catalog = table description / schema / partition
  • Athena = run SQL

What can Athena read?

  • Athena can query files such as: CSV · JSON · Parquet · ORC · Avro

For example:

s3://logs/orders/
↓
Athena
↓
SELECT *
FROM orders
WHERE year = 2026;
  • No need to import data into Athena first.

Serverless

  • Athena does not need: Provision server · Choose instance · Manage cluster · Patch server

You just:

There is data in S3
↓
Definition of table/schema
↓
Run SQL

Without a query, there is almost no compute Athena has to run for that query.

Pricing: Data Scanned

  • Athena mainly charges according to: The amount of data scanned by the query
  • According to the slides: ≈ $5 / TB scanned

So:

Scan less
↓
Query is cheaper
+
usually faster

Prices may vary by Region/time.

Data Scanned example

  • Let's say S3 has: 1 TB CSV data
  • Query: SELECT name · FROM users;
  • With CSV, Athena may have to read a lot of file data.

If the same data is saved using Parquet:

  • Athena just needs to read the column "name"
  • → scan less.

Parquet / ORC

  • Parquet and ORC are columnar formats.
  • For example the table has: Name · Age · Country · Salary · Email
  • SELECT Name, Salary · FROM employees;
  • CSV: often have to read the entire row/file
  • Parquet: read only: · Name · Salary
  • → reduce scanned data.
  • Parquet / ORC = less scans = faster = cheaper

Compression

  • Files can be compressed: gzip · Snappy · zstd · ...
Data
↓
Compression
↓
Smaller files
↓
Athena reads fewer bytes
  • → can reduce cost and reading time.

Partition

  • Partition: Groups S3 data by values, such as year=2026/month=09/day=29/.
  • Partition column: A column used to select data groups, such as year, month, or day; Athena has metadata describing those groups.
  • Querying: A suitable partition filter lets Athena read the relevant portion instead of scanning everything.
  • Example: WHERE year = 2026 AND month = 9 reads the September 2026 group when data is partitioned and filtered appropriately.

Partition is Virtual Column

For example, the Parquet file inside does not necessarily contain:

  • But S3 path: /year=2026/month=09/day=29/; Tell Athena: year = 2026 · month = 09 · day = 29

Partition value can come from the S3 path, not necessarily in the file.

If not filter Partition

  • Suppose: 2024/ · 2025/ · 2026/
  • SELECT * · FROM logs;
  • → Athena can scan everything.
  • If: WHERE year = 2026
  • → only scan partition 2026.

Glue + Athena

Raw data:

CSV / JSON
↓
AWS Glue
↓
Convert
↓
Parquet + Partition
↓
S3
↓
Athena
  • This is a very common pattern: Glue = prepare data
  • Athena = query data

Glue Data Catalog

  • Athena needs to know: What is the name of the table? · What columns? · What type of data? · Where is S3 location? · What partition?
  • Glue Data Catalog stores that metadata.

S3 = Data

  • Glue Data Catalog = Metadata
  • Athena = SQL Engine

Athena + QuickSight

Can create BI flow:

S3
↓
Athena
↓
QuickSight
↓
Dashboard
Sales Data on S3
↓
Athena SQL
↓
QuickSight
↓
Sales Dashboard

Log Analytics

Athena is great for query logs stored in S3:

  • CloudTrail Logs · VPC Flow Logs · ALB / ELB Logs · Application Logs
CloudTrail
↓
S3
↓
Athena
↓
"Find all DeleteBucket API calls"
  • No need to build a separate log database.

Federated Query

  • Athena doesn't just query S3.
  • Can query other sources through Data Source Connector.
Athena
↓
Lambda Connector
↓
DynamoDB / RDS / DocumentDB / ...
Athena SQL
↓
Lambda Connector
↓
DynamoDB
↓
Result
  • Sources may include: DynamoDB · Aurora / RDS · DocumentDB · Redshift · ElastiCache · On-prem Database · ...

Federated Query Flow

Analyst
↓
Athena SQL
↓
Lambda Data Source Connector
↓
External Database
↓
Return Data
↓
Athena
↓
Result saved to S3
  • Suitable when needed: Ad-hoc query · Join temporary data · Query multiple sources
  • This does not mean that Athena turns those databases into data warehouses.

File Size

  • Should avoid: 10 million files is very small; because Athena has to open and process too many objects.
  • Usually better: Fewer files + reasonably large files
  • Suggested slide ranges: > 128 MB / file; But this is a guideline, not a mandatory rule.

Athena optimization

  • Remember 4 main things: 1. Parquet / ORC · 2. Compression · 3. Partition · 4. Avoid too many small files

Ideal flow:

Raw CSV / JSON
↓
Glue
↓
Parquet
+ Compression
+ Partition
↓
S3
↓
Athena

4. Practical example

Operations queries S3 access logs with SQL and scans only the partition for the incident date.

CloudTrail Logs
↓
S3
↓
Athena
↓
Security Investigation
Raw Data
↓
Glue
↓
Parquet + Partition
↓
S3
↓
Athena
↓
QuickSight
S3 + DynamoDB / RDS
↓
Athena Federated Query
↓
Ad-hoc Analytics

5. Comparison

Athena suits ad hoc data-lake queries; Redshift suits warehouses and purpose-tuned BI workloads.

Athena vs Redshift

Athena = direct query S3 = serverless = ad-hoc analytics = pay per data scanned

Redshift = Data Warehouse = data optimized for analytics = query/join/aggregate frequently

Occasionally query logs in S3
→ Athena
BI dashboard runs continuously
+ multiple joins / aggregates
→ Redshift
Amazon Redshift

1. Concept

Redshift is a data warehouse for aggregating and analyzing large datasets with SQL for business reporting.

2. Purpose

Aggregate and analyze large datasets for BI, joins, and OLAP queries.

3. How it works

  • Amazon Redshift is a data warehouse that uses SQL for analytics/BI, suitable for large queries, joins, aggregates and reporting on large amounts of data.
  • Redshift = Data Warehouse = SQL = OLAP
  • Not suitable as the main database for application transactions.
Order / Payment / Account Update
→ RDS / Aurora / DynamoDB

Analytics / Reporting / BI
→ Redshift

Popular flow

RDS / Aurora / DynamoDB / S3
↓
ETL / ELT
↓
Redshift
↓
SQL Analytics
↓
QuickSight / Tableau

For example:

Sales Data
Product Data
Customer Data
↓
Redshift
↓
JOIN + GROUP BY
↓
Sales Dashboard

Why is Redshift fast for Analytics?

  • Redshift is optimized with: Columnar Storage · MPP · Sort Key · Distribution

Columnar Storage

  • Data is stored in columns instead of rows.
  • Table example: Name · Age · Country · Salary
  • Query: SELECT Country, AVG(Salary) · FROM employees · GROUP BY Country;
  • Redshift mainly needs to read: Country · Salary; instead of the entire row.
  • Columnar = scan fewer columns = suitable for analytics

MPP

  • MPP = Massively Parallel Processing
  • Redshift divides the query into multiple compute nodes for parallel processing.
SQL Query
↓
divided into several parts
↓
Compute Node 1
Compute Node 2
Compute Node 3
↓
parallel processing
↓
Result

MPP = multiple machines processing one large query.

Sort Key

  • Sort Key helps data to be sorted by columns commonly used for filtering.
  • Sort Key = OrderDate
  • WHERE OrderDate >= '2026-09-01'
  • → Redshift can skip many unrelated data blocks.
  • Sort Key = reduce the data to be scanned

Distribution

  • Distribution: Determines which Redshift compute nodes store the data.
  • Goal: Spread work evenly and reduce data movement when joining tables.
  • Sort key: Controls data ordering to help find the relevant data faster; it does not assign data to nodes.
Data
↓
Compute Node 1
Compute Node 2
Compute Node 3

Sort Key = how data is sorted. Distribution = which node the data is located at.

Cluster Architecture

In provisioned Redshift:

Client
↓
Leader Node
↓
Compute Nodes
1. Leader Node
  • Leader Node = receive SQL = create query plan = divide work among compute nodes = synthesize results
2. Compute Nodes
  • Compute Nodes = scan data = join = aggregate = parallel processing
QuickSight/Client
↓
Leader Node
↓
split query
↓
Compute Nodes
↓
parallel processing
↓
General leader
↓
Result

Snapshot

  • Snapshot = backup of Redshift cluster at a point in time.
Redshift Cluster
↓
Snapshot
↓
Backup
  • Snapshots are incremental: Headshot = full data
  • Snapshot sau = saves only the changes

Restore Snapshot

  • Restore does not overwrite the old cluster.
Snapshot
↓
Restore
↓
New Redshift Cluster

Restore Snapshot = create new cluster.

Automated Snapshot

  • Redshift automatically creates backups periodically.
Cluster
↓
Automated Snapshot
↓
Retention Window
  • Used for: Regular Recovery · Accidental Change · Operational Backup

Manual Snapshot

You create it yourself:

Redshift
↓
Manual Snapshot
  • Keep it until you delete it.
  • Before migration · Before major change · Long-term backup

Cross-Region Snapshot

You can copy snapshots to another Region:

Region A
Redshift
↓
Snapshot
↓
Copy
↓
Region B
  • Disaster Recovery

If Region A has problems:

Snapshot in Region B
↓
Restore
↓
New Cluster

Multi-AZ

  • Redshift supports Multi-AZ for suitable configurations.
AZ A
+
AZ B
↓
Redshift
  • High Availability
  • Multi-AZ ≠ Cross-Region DR
  • Cross-Region still uses its own snapshot copy/DR strategy.

QuickSight / Tableau

Redshift often works as a backend for BI:

Redshift
↓
QuickSight / Tableau
↓
Dashboard
Sales
Orders
Products
Customers
↓
Redshift
↓
JOIN / Aggregate
↓
QuickSight
↓
Business Dashboard

4. Practical example

A company aggregates years of sales data to analyze revenue by region and product.

RDS / S3
↓
ETL
↓
Redshift
↓
QuickSight
Sales + Product + Customer
↓
Redshift
↓
Large JOIN / Aggregate
↓
BI Dashboard
Redshift
↓
Automated Snapshot
↓
Recovery
Snapshot
↓
Cross-Region Copy
↓
Disaster Recovery

5. Comparison

Redshift serves OLAP; RDS/Aurora commonly serve OLTP; Spectrum adds S3 data to analytical queries.

OLAP vs OLTP

1. OLTP

Used for application transactions: Create Order · Update User · Payment · Insert / Update small and frequently

Suitable: RDS · Aurora · DynamoDB

2. OLAP

Used to analyze a variety of data: SUM · COUNT · GROUP BY · JOIN · Reporting · Analytics

Redshift

Redshift = OLAP, not OLTP database.

Provisioned vs Serverless

  • Redshift Provisioned: You choose the node type, node count, and processing capacity; suitable for predictable demand and direct capacity control.
  • Your responsibility: Monitor the cluster, plan usage, and resize when needed.
  • Redshift Serverless: AWS provisions and adjusts query processing resources without you managing individual nodes.
  • When to use it: Variable demand, occasional analysis, or teams that do not want to manage a cluster.
Do not manage clusters/nodes directly
↓
AWS provides compute on its own
↓
run query

Redshift vs Athena

Both use SQL for analytics but work differently.

1. Athena
S3 Files
↓
Athena
↓
SQL

= query S3 directly = serverless = ad-hoc = pay per data scanned

2. Redshift
Data
↓
Load / Model into Warehouse
↓
Redshift
↓
SQL

= data warehouse = optimal for repeated queries = strong with large JOIN / Aggregates

Occasionally query CloudTrail logs
→ Athena
Dashboard sales runs continuously
+ multiple JOIN / GROUP BY
→ Redshift

Redshift Spectrum & Comparison of Provisioned vs Serverless for Data Services

Redshift Spectrum: Use Redshift's computing power to directly query SQL data on S3 (join immediately with Redshift internal tables) without having to first load the entire file into the cluster; If only simple ad-hoc queries on S3 do not have Redshift available, priority is given Athena.

Data servicesProvisioned modeServerless mode
Amazon RedshiftManage the type/number of nodes in the clusterSelf-scaling data warehouse capacity accordingly RPU
Amazon OpenSearchChoose your own domain instances and EBSSelf-scaling search/vector according to OCU
Amazon MSK (Kafka)Choose the number of brokers and disk capacitySelf-scaling throughput streaming, without managing brokers
AWS DMSChoose your own replication instance sizeSelf-scaling between min/max DCU for Full Load & CDC
Amazon OpenSearch Service

1. Concept

OpenSearch builds indexes for fast searches across text and multiple data fields.

2. Purpose

Support flexible multi-field searches and log analysis through search indexes.

3. How it works

  • Amazon OpenSearch Service is a managed search + analytics service, used to create a search index to help search quickly and flexibly across many fields.
  • OpenSearch = Search Engine + Log Analytics + Dashboard

Database keeps original data, OpenSearch keeps index for quick search.

What is OpenSearch used for?

  • Product examples include: Name · Description · Category · Tags · Brand
  • User search: "iphone pro"
  • OpenSearch can: Full-text Search · Partial Match · Filter · Sort · Ranking

For example:

"iph pro"
↓
OpenSearch
↓
iPhone 15 Pro
iPhone 16 Pro

Why not just use DynamoDB?

  • DynamoDB is strong when querying with: Partition Key · Sort Key · Secondary Index
  • But if needed: Search by text · Partial Match · Autocomplete · Search multiple fields
  • then OpenSearch is more suitable.
ProductId = 123
→ DynamoDB
"wireless noise cancelling headphone"
→ OpenSearch

Eventual Consistency

  • Eventual consistency: The search copy may update slightly later than the primary database.
  • Example: A product price changes in DynamoDB while OpenSearch search results briefly show the old price during synchronization.
  • When freshness matters: Read from the appropriate primary source rather than assuming the search copy is immediately current.
DynamoDB Update
↓
Streams
↓
Lambda
↓
OpenSearch Update

Log Analytics

  • OpenSearch is also very popular for searching logs.
Application Logs
↓
CloudWatch Logs
↓
OpenSearch
↓
Search / Filter / Dashboard

There are 2 popular flows:

CloudWatch Logs
↓
Subscription Filter
↓
Lambda
↓
OpenSearch

or:

CloudWatch Logs
↓
Subscription Filter
↓
Firehose
↓
OpenSearch

OpenSearch Dashboards

OpenSearch has a visualization interface:

Indexed Data
↓
OpenSearch Dashboards
↓
Chart / Graph / Search
Error Logs
↓
OpenSearch
↓
Dashboard:
Error Count
Top IP
Latency
Status Code

Security

  • OpenSearch can use: IAM · VPC / Network Policy · TLS · KMS Encryption · Cognito for Dashboard login
User
↓
Cognito
↓
OpenSearch Dashboards
  • While: IAM = control API access

OpenSearch is not a transactional database

OpenSearch should not be used as a source of truth for:

  • Payment · Order Transaction · Account Balance
  • Should: RDS / DynamoDB = save standard data; and: OpenSearch = search / analytics

4. Practical example

A website stores orders in its primary database and indexes selected data in OpenSearch for flexible searches.

Product Catalog
↓
OpenSearch
↓
Full-text Search
DynamoDB
↓
Streams
↓
Lambda
↓
OpenSearch
↓
Search Index
CloudWatch Logs
↓
OpenSearch
↓
Error Investigation
↓
Dashboard
IoT / Firehose
↓
OpenSearch
↓
Filter / Aggregate / Visualize

5. Comparison

  • A search index optimizes search; the primary database holds transactional data; asynchronously updated indexes can lag behind.

Database vs OpenSearch

DynamoDB example: DynamoDB = source of truth = saves real data

OpenSearch: OpenSearch = search index = search service

Application
↓
DynamoDB
↓
Streams
↓
Lambda
↓
OpenSearch

Khi user:

Get item by ID
→ DynamoDB
Search by Name / Description / Tag
→ OpenSearch

Lambda vs Firehose Ingest

  • Lambda = flexible transform log = more custom logic
  • Firehose = managed delivery = buffering = less self-management
  • Remember: Lambda path = event-driven / custom transform
  • Firehose path = managed near real-time delivery

Managed vs Serverless

  • There are 2 types of deployment: Provisioned OpenSearch = you choose cluster capacity
  • OpenSearch Serverless = AWS manages scaling/capacity more
  • Provisioned = more control over the cluster
  • Serverless = less infrastructure management
Amazon EMR

1. Concept

EMR runs Spark, Hadoop, and other big-data tools on managed AWS infrastructure.

2. Purpose

Run big-data workloads using supported frameworks and suitable customization.

3. How it works

  • Amazon EMR is a managed service for running big-data processing clusters across multiple EC2 instances.
  • EMR = Spark / Hadoop / HBase / Presto / Flink = big data processing in a distributed fashion
  • AWS takes care of basic provisioning/configuration; You still choose the framework, nodes, and how to optimize your workload.

Node in EMR

  • Primary = cluster coordination = health management / job schedule
  • Core = run task = save data in cluster
  • Task = only runs task = does not keep data
Primary
↓ divide job into multiple tasks
Core + Task Nodes
↓
parallel processing
↓
Output

Primary dispatcher, Core = compute + data, Task = compute only.

Spot / On-Demand

  • On-Demand = stable = not reclaimed like Spot
  • Spot = cheaper = can be terminated
  • Spot is often best suited for: Task Nodes; Because the Task node does not hold data and the task can retry.
  • Primary/Core usually needs more stability.

Auto Scaling

EMR can automatically change the number of nodes according to workload:

Job increases
↓
add node

Job decreased
↓
reduce nodes
  • → reduce costs when workload changes.

Popular flow

S3/HDFS
↓
EMR
↓
Spark/Hadoop Job
↓
Core + Task parallel processing
↓
S3 / Data Store
  • Important data should be saved in sustainable storage such as S3, especially when using Spot or transient clusters.

4. Practical example

A team runs Spark on a large S3 dataset, writes results, and terminates its transient cluster.

Big Data on S3
↓
Spark on EMR
↓
Transform / Feature Engineering
Hadoop / HBase workload
↓
EMR
Large-scale ML preprocessing / Web indexing
↓
EMR Cluster

5. Comparison

EMR suits big-data frameworks and customization; Glue focuses on data integration; Athena focuses on SQL queries.

Long-running vs Transient Cluster

1. Long-running

Cluster is always running

Suitable: Notebook · Interactive workload · HBase · Service needs to operate continuously

2. Transient
Create Cluster
↓
Run Job
↓
Write the results to S3
↓
Terminate Cluster

Suitable for: Batch · Periodic ETL · Spark processing

→ avoid paying when cluster is idle.

EMR vs Athena vs Glue

  • EMR = Spark / Hadoop / Flink = custom big-data code = more cluster control
  • Athena = Ad-hoc SQL directly on S3 = no cluster management
  • Glue = serverless ETL = less infrastructure management

Instance Groups vs Instance Fleets, Managed Scaling & Spark Catalog

Concepts on EMRDistinguishing point
EMR Instance Group vs EMR Instance FleetInstance Group fixes one EC2 type per node group; Instance Fleet Allows mixing many types of EC2 + On-Demand/Spot and manually selecting the available AZ
EMR Managed ScalingAutomatically increase/decrease the number of Core and Task nodes continuously according to the actual load of the job to optimize costs
Apache Spark vs Spark CatalogSpark is a distributed processing engine; spark_catalog (usually integrated Glue Data Catalog) only manages table/schema metadata, not original data
Amazon QuickSight

1. Concept

QuickSight creates charts and interactive dashboards from business data.

2. Purpose

Turn data into dashboards and reports that business users can consume.

3. How it works

Amazon QuickSight is a serverless Business Intelligence (BI) service for creating:

  • Charts · Reports · Interactive Analysis · Dashboards
  • QuickSight is used to visualize data and create insights, not a database, data warehouse or ETL engine.
  • QuickSight = BI = Visualization = Dashboard

Where does QuickSight get its data?

  • Can connect to: RDS · Aurora · Athena · Redshift · S3 · OpenSearch · Timestream
  • There are also: CSV / XLSX / JSON / TSV · Salesforce / Jira · On-prem database qua JDBC
Data Source
↓
QuickSight
↓
Charts / Dashboard

Direct Query

  • QuickSight can directly query the data source.
QuickSight
↓
Redshift / Athena / RDS

Each time the dashboard needs data:

QuickSight
↓
query source
↓
get results
  • Advantages: Newer data
  • Disadvantages: Depends on source speed · Increase source load

SPICE

  • SPICE = QuickSight's in-memory engine.
Data Source
↓
Import
↓
SPICE
↓
Dashboard
  • QuickSight queries the imported data in memory instead of continuously querying the source.
  • Benefits: Faster dashboard · Reduced database load

In return:

Data is not automatically always fresh
↓
need refresh

Sharing

  • Dashboards can: Share with QuickSight User · Share with QuickSight Group · Embed into application
Redshift
↓
QuickSight
↓
Sales Dashboard
↓
Embed into the company portal
  • QuickSight users/groups is the identity within QuickSight.
  • QuickSight Group ≠ IAM Group

Column-Level Security

  • Enterprise edition supported Column-Level Security (CLS).
  • Table example: Name · Department · Salary · Email
  • HR: Sales user: Name · Department · Email
  • don't see: Salary

CLS = controls which columns the user can view.

Row-Level Security

  • In addition to columns, you can limit by row.
User Singapore
→ only see Region = Singapore

User Vietnam
→ only see Region = Vietnam
  • RLS = controls which rows the user can see
  • Remember: CLS = Column

RLS = Row

Security Layers

There are two different types of permissions:

QuickSight → Data Source
  • QuickSight needs permission/credential to read the database.

And:

User → QuickSight Dashboard
  • QuickSight user/group decides who gets to see the dashboard.

Having permission to view the dashboard does not mean that the user directly has access to the source database.

What doesn't QuickSight do?

  • QuickSight is not: Data Warehouse · ETL Engine · Transactional Database
  • Glue = transform data
  • Redshift = warehouse
  • Athena = query data
  • QuickSight = visualize results

4. Practical example

Sales teams view revenue dashboards; row-level security limits each region to its own data.

S3
↓
Athena
↓
QuickSight
↓
Dashboard
Redshift
↓
QuickSight
↓
Sales / Finance Dashboard
Timestream / OpenSearch
↓
QuickSight
↓
Operational Dashboard
Dashboard
↓
Embed
↓
Web Application

5. Comparison

QuickSight visualizes data; Athena/Redshift query and analyze it; SPICE and direct queries differ in caching and freshness.

Analysis vs Dashboard

  • Analysis: The workspace where an author builds and edits charts, filters, parameters, controls, and sorting.
  • Dashboard: A published version of an analysis shared with viewers.
  • Viewers: Can filter and drill into data within the published dashboard's scope without editing the source analysis.
  • Example: An analyst builds revenue charts in an analysis, then publishes a dashboard for managers to view by month or region.
Sales Analysis
├── Revenue chart
├── Region filter
├── Date filter
└── Product chart
Analysis
↓
Publish
↓
Dashboard

Direct Query vs SPICE

Direct Query = query source directly = fresher data = depends on source

SPICE = import copy into QuickSight = faster = need to refresh

Direct Query = prioritize freshness. SPICE = performance priority.

AWS Glue & Lake Formation

1. Concept

Glue discovers and prepares data; Lake Formation centrally manages access to a data lake.

2. Purpose

Prepare data, maintain metadata, and centrally govern data-lake access.

3. How it works

  • AWS Glue provides serverless ETL and metadata catalog to prepare data for analytics;
  • AWS Lake Formation builds a data lake management layer on Glue to ingest, catalog, and centrally control access to data typically stored in S3.
  • AWS Glue = ETL + Data Catalog
  • Lake Formation = Governance + Permission for Data Lake
  • S3 = contains data
  • Glue = learn data + transform data
  • Lake Formation = control who can see the data

AWS Glue

  • Glue is the service serverless ETL.
Extract
↓
Transform
↓
Load

For example:

Raw CSV/JSON on S3
↓
Glue
↓
Clean + Convert Parquet + Partition
↓
Curated Data on S3
↓
Athena / Redshift / QuickSight

Glue Crawler

  • Glue Crawler: Inspects data to discover columns, data types, partitions, and storage locations.
  • Sources: Reads supported sources such as S3, RDS, DynamoDB, or JDBC connections.
  • Output: Stores metadata in the Glue Data Catalog so other tools know how to read the data.
  • Example: A crawler finds id, price, and date columns in order files and creates a table description. It does not transform the order files.

Glue Data Catalog

  • Glue Data Catalog: A directory describing data: table names, columns, data types, partitions, and storage locations.
  • Actual data: Remains at the source, such as S3; the catalog stores descriptions, called metadata.
  • Example: An orders table has id, price, and date columns and points to s3://data/orders/.
  • Consumers: Athena, Redshift Spectrum, EMR, and Glue use the catalog to locate and read data.

Job Bookmark

  • Job Bookmark remembers which data has been processed.
Run 1
→ process files A and B

Run 2
→ only processes C files

Instead:

A + B + C
→ reprocess everything

Bookmark = avoid reprocessing old data.

  • It should not be understood as an exactly-once guarantee for every pipeline.

Glue Studio & DataBrew

  • Glue Studio = GUI create/run/monitor Glue Jobs
  • DataBrew = low-code/no-code data cleaning
  • DataBrew is suitable for: Remove duplicate · Normalize · Clean values · Standardize data

Glue Streaming ETL

  • In addition to batch ETL, Glue can handle streams.
Kinesis / Kafka / MSK
↓
Glue Streaming ETL
↓
Transform
↓
S3 / Analytics Target
  • It uses: Apache Spark Structured Streaming

AWS Lake Formation

  • Lake Formation is used to manage and protect Data Lake.
  • Lake Formation = Data Lake Governance
  • Usually data is still located in: Amazon S3
  • Lake Formation is not new storage.

Fine-Grained Access

Lake Formation can limit permissions to:

  • Database · Table · Column · Row

Table example:

Employee
├── Name
├── Department
└── Salary
  • HR: Name ✅ · Department ✅ · Salary ✅
  • Analyst: Name ✅ · Department ✅ · Salary ❌
  • Column-Level Access

Rows can be limited:

Vietnam Team
→ only see Region = Vietnam

Lake Formation does not replace IAM/S3/KMS

  • Lake Formation is an additional layer of governance.
  • You may still need: IAM · S3 permissions · KMS permissions · Network access

Example file using SSE-KMS:

User
↓
Lake Formation allows tables
↓
but no KMS permission
↓
Still can't read data

Full Flow Data Lake

S3 / RDS / DynamoDB
↓
Glue Crawler
↓
Glue Data Catalog
↓
Glue ETL
↓
Curated S3 Data Lake
↓
Lake Formation
↓
Fine-Grained Permission
↓
Athena / Redshift / EMR
↓
QuickSight

4. Practical example

Glue converts CSV to Parquet; Lake Formation lets analysts access only approved columns.

Raw CSV
↓
Glue
↓
Parquet + Partition
↓
S3
↓
Athena
Company Data Lake
↓
Lake Formation
↓
Finance only views Finance data
HR only views HR data
Kinesis / MSK
↓
Glue Streaming ETL
↓
Clean data
↓
S3 / Redshift

5. Comparison

Crawlers discover schemas; Glue jobs transform data; the Data Catalog stores metadata; Lake Formation governs lake access.

Crawler vs Glue Job

Crawler = What structure does this data have?

Glue Job = How to transform data?

S3 Raw CSV
↓
Crawler
↓
Catalog knows schema

Then:

Raw CSV
↓
Glue Job
↓
Clean / Join / Filter
↓
Parquet

Glue vs Lake Formation

Glue = data has what schema? = transform data how?

Lake Formation = Who can see which data?

S3 Data Lake
↓
Glue Catalog
↓
Lake Formation Permissions
↓
Athena
↓
User
Streaming platforms: Amazon MSK & Managed Service for Apache Flink

1. Concept

MSK runs Kafka to store and transport streams; Flink processes streaming data while maintaining processing state.

2. Purpose

Operate Kafka streams and stateful processing without building the entire platform.

3. How it works

  • Amazon MSK is managed Apache Kafka to stream event streams by topic/partition;
  • Amazon Managed Service for Apache Flink (formerly Kinesis Data Analytics for Apache Flink) runs Flink managed applications to process real-time streams from Kinesis Data Streams or MSK.
  • Amazon MSK = Managed Apache Kafka = receive and transmit event stream
  • Managed Service for Apache Flink = real-time stream processing
Producer
↓
MSK / Kafka
↓
Flink
↓
Transform / Aggregate / Detect
↓
Sink

Amazon MSK

  • Amazon MSK is Apache Kafka is managed by AWS.
  • Instead of self: Install Kafka · Manage broker · Patch · Recovery · Scaling
  • AWS manages the infrastructure for you.
  • MSK = Kafka API + Kafka ecosystem + Managed infrastructure
  • Clusters usually run in VPC and can span multiple AZs to increase HA.

Kafka Model

  • Kafka has 3 important components: Producer = send event
  • Topic = stream / event type
  • Consumer = read event

For example:

Order Service
↓ Producer
Topic: orders
↓
Fraud Consumer
Analytics Consumer
Notification Consumer
  • An event stream can be processed independently by multiple consumers.

Topic & Partition

  • Topics are divided into: Partitions
orders topic
├── Partition 0
├── Partition 1
└── Partition 2
  • Partition helps: Parallel Processing · Scale throughput

Consumer Group can divide partitions among multiple consumers:

Partition 0 → Consumer A
Partition 1 → Consumer B
Partition 2 → Consumer C

Topic = logical stream, Partition = parallelism unit.

  • Kafka can add partition, but does not reduce partition count directly.

Producer & Consumer is still your code

  • MSK manages the Kafka infrastructure, but the business logic is still handled by the application.
Producer Code
↓
MSK
↓
Consumer Code
↓
Business Logic
  • MSK does not understand: Order · Payment · Fraud · Customer; it just transports/saves event.

Storage & Replication

Kafka records are saved according to retention:

Producer
↓
Broker
↓
EBS Storage

Broker can replicate data:

Broker A
↓ replicate
Broker B
↓
Broker C
  • → increase durability and availability.

MSK Serverless

  • Two main ways: Provisioned MSK = select/manage broker capacity
  • MSK Serverless = AWS self-provisioning + scale capacity
  • Serverless is suitable when: Traffic changes a lot · Don't want capacity planning
  • Provisioned is suitable when more cluster/capacity control is needed.

Managed Service for Apache Flink

  • Flink is used for Process data while the stream is running.
Kinesis / MSK
↓
Flink
↓
Transform
Filter
Aggregate
Join
Window
↓
Output
  • Can be written with: Java · Scala · SQL

Flink example

Event:

User A → $100
User A → $500
User A → $3000

Flink can:

Group by User
↓
total in 5 minutes
↓
Abnormal detection
↓
Fraud Alert
  • Here it is stateful stream processing.

Flink State & Checkpoint

  • Flink can remember state between events.
  • User A total = $600
  • New event: +$3000
  • Flink continues from the old state: Total = $3600

To recover:

State
↓
Checkpoint / Snapshot
↓
Failure
↓
Restore State

Checkpoint = saves state so Flink can continue after failure.

Auto Scaling & Parallelism

Flink can parallelize:

Stream
↓
Worker 1
Worker 2
Worker 3

When throughput increases:

Auto Scaling
↓
More Compute
  • But correctness still depends: Checkpoint · Offsets · Duplicate handling · Late events · Sink idempotency

Where does Flink read from?

  • According to slide content: Kinesis Data Streams ✅ · Amazon MSK ✅ · Data Firehose ❌
  • Remember: KDS / MSK = stream source
  • Flink = stream processor

MSK Consumer

  • MSK can be consumed by: Managed Flink · Glue Streaming ETL · Lambda · EC2 / ECS / EKS Application
Application
↓
MSK
├── Flink → Real-time Analytics
├── Lambda → Business Logic
└── Glue → S3 Data Lake

4. Practical example

Transaction events enter Kafka on MSK; a Flink application calculates spending totals within time windows.

Microservices
↓
MSK
↓
many independent consumers
Kinesis / MSK
↓
Flink
↓
Fraud Detection
Clickstream
↓
Flink
↓
5-minute aggregation
↓
Analytics
Variable Kafka Traffic
↓
MSK Serverless

5. Comparison

MSK is a Kafka streaming platform; Flink is a processing engine; Kinesis Data Streams is an AWS-native streaming option.

Kinesis Data Streams vs MSK

Kinesis Data Streams = AWS-native streaming = uses Shards

MSK = Apache Kafka = use Topics + Partitions

Kinesis
→ want AWS-native, less interested in Kafka ecosystem
MSK
→ app used Kafka
→ needs Kafka APIs / ecosystem

Shard vs Partition

Kinesis = Shard

Kafka / MSK = Partition

Both are used to: chia workload + parallel processing

And we all need to choose a reasonable partition key to avoid:

Hot Partition / Hot Shard

Serverless big-data ingestion pipeline

1. Concept

An ingestion pipeline separates event intake, storage, preparation, and analysis into stages.

2. Purpose

Separate collection, storage, and analysis so a pipeline can scale and handle failures clearly.

3. How it works

  • This is a pattern to receive real-time events → save to S3 → query with Athena → create dashboard/report without having to manage the ingestion cluster yourself.
IoT Devices
↓
IoT Core
↓
Kinesis Data Streams
↓
Data Firehose
↓
S3
↓
Athena
↓
QuickSight / Redshift

Role of each service

  • IoT Core = receive events from IoT devices
  • Kinesis Data Streams = streaming ingestion real-time
  • Data Firehose: buffer + delivery managed → usually writes to S3
  • S3 = save raw / processed data
  • Athena = SQL query on S3
  • QuickSight = dashboard / visualization
  • Redshift = warehouse analytics if large queries/joins are needed frequently

Full flow

IoT Devices
↓
IoT Core
↓
Kinesis Data Streams
↓
Data Firehose
↓
Lambda Transform (optional)
↓
S3 Ingestion Bucket
↓
SQS (optional)
↓
Lambda
↓
Athena Query
↓
S3 Reporting Bucket
↓
QuickSight / Redshift

Kinesis Data Streams

  • KDS receives data real-time.
Devices / Applications
↓
Kinesis Data Streams
↓
continuous records

For example:

  • Temperature event · Click event · Application log · Telemetry
  • Need to choose: Partition Key; reasonable to avoid hot shards.

Data Firehose

  • Firehose took the stream buffer and delivery to destination.
Kinesis Data Streams
↓
Firehose
↓
S3
  • Firehose can: Buffer records · Batch records · Retry delivery · Transform using Lambda
  • Because there is buffering: Firehose = Near Real-Time; Not every event that arrives immediately appears in S3.

Lambda Transform in Firehose

Can add:

Firehose
↓
Lambda
↓
Transform Record
↓
S3
Raw JSON
↓
Clean / Add field / Change format
↓
S3
  • Lambda here is optional.

S3 + SQS + Lambda

When Firehose writes the file to S3:

S3 Event
↓
SQS
↓
Lambda
  • SQS is used to: Buffer · Retry · Decouple · Handle traffic spike

If the pipeline is simple:

S3
↓
Lambda

also.

Why add SQS?

Without SQS:

S3 Event
↓
Lambda

Yes SQS:

S3 Event
↓
SQS Queue
↓
Lambda

If Lambda is slow:

Message
→ wait in SQS
  • instead of applying pressure directly to Lambda.

SQS = buffer + decouple + retry.

SQS does not guarantee exactly-once

  • Reprocessing: A message or event may be received and processed more than once.
  • Idempotent: Repeating the same request produces only the intended single result.
  • Example: Use a file ID or job ID to recognize completed work and avoid duplicate rows or two reports for one file.
Same Event
↓
Lambda
↓
can run multiple times

Athena Query

Lambda can trigger Athena:

Lambda
↓
Start Athena Query
↓
Athena reads data from S3
↓
SQL
  • SELECT device_id, AVG(temperature) · FROM telemetry · GROUP BY device_id;
  • Athena saves the result to: S3 Reporting Bucket

Query Result is in S3

Athena
↓
Query Result
↓
S3

Then:

QuickSight
↓
Dashboard

or:

Reporting Data
↓
Redshift
↓
Warehouse Analytics

4. Practical example

Clickstream flows through Firehose into S3, Glue catalogs it, and Athena supports dashboard queries.

IoT Devices
↓
Kinesis
↓
S3
↓
Athena
↓
QuickSight

→ IoT telemetry dashboard.

Application Logs
↓
Kinesis
↓
Firehose
↓
S3
↓
Athena

→ log analytics.

Clickstream
↓
S3
↓
Athena
↓
Redshift
↓
BI

→ big analytics/reporting.

5. Comparison

  • Real-time stream processing and reports over buffered data have different latency; choose according to freshness requirements.

Real-Time vs Near Real-Time

Kinesis Data Streams = Real-Time Streaming

Firehose = Buffer + Delivery = Near Real-Time

Event occurs
↓
KDS received it immediately
↓
Firehose buffer
↓
Then write the batch to S3

Therefore, the entire pipeline to the dashboard is usually not strict real-time.

QuickSight vs Redshift at the end of the pipeline

Athena / S3
↓
QuickSight

Use when: Dashboard · Reporting · Visualization

If needed: many JOINs · large aggregates · continuously repeated queries

then:

S3
↓
Redshift
↓
QuickSight

may be more suitable.

AWS Data Pipeline, Amazon MWAA & AWS Data Exchange

1. Concept

Data Pipeline and MWAA orchestrate data tasks; Data Exchange provides datasets from external providers.

2. Purpose

Orchestrate complex scheduled/dependent data processing workflows and integrate third-party data sets to AWS.

3. How it works

AWS Data Exchange

  • AWS Data Exchange: data marketplace helps subscribe to commercial/public datasets from third-party providers and receive them directly into S3, Redshift, Lake Formation or via API without having to write your own collection pipeline.

4. Practical example

A team uses MWAA for a daily DAG and includes subscribed Data Exchange datasets in reports.

5. Comparison

  • MWAA orchestrates Airflow DAGs;
  • Data Exchange distributes datasets;
  • Data Pipeline is a legacy service with availability considerations.

Amazon MWAA vs AWS Data Pipeline

ServiceRoles & Distinguishing Points
Amazon MWAA (Managed Workflows for Apache Airflow)Run environment Apache Airflow managed to orchestrate multi-step data pipelines using Python code (DAGs), handling dependencies, retries, and warnings; MWAA itself coordination only, while computation/storage is handled by S3, Glue, EMR, Redshift
AWS Data PipelineService that coordinates periodic data migration and transformation between AWS/on-premises data warehouses according to dependencies
Amazon MWAA (scheduled DAG) → enable AWS Glue ETL read S3 → load Amazon Redshift table → send SNS notification

Machine Learning & AI

Amazon Rekognition & Textract

1. Concept

Rekognition analyzes image/video content; Textract extracts text, tables, and form data from documents.

2. Purpose

Analyze visual content or extract document data without training the underlying models.

3. How it works

  • These are ML services available to process images, videos and documents.
  • Rekognition = understand image / video content
  • Textract = read document / scan = get text + table + form

Amazon Rekognition

Rekognition is used to analyze images/videos:

Image / Video
↓
Rekognition
↓
Object / Person / Face / Text / Scene
  • Can be used for: Object Detection · Face Detection · Face Search / Compare · Text Detection · Content Moderation

For example:

User uploads image
↓
Rekognition
↓
detect:
Car
Person
Dog
Text

Content Moderation

  • Used to detect sensitive/inappropriate content.
Image / Video
↓
Rekognition Moderation
↓
Confidence Score

Threshold can be set:

Confidence is high
→ Flags

Not sure
→ Human Review
  • Human review can be used: Amazon A2I = give ML results to reviewer

Amazon Textract

  • Textract is used to get data from document.
PDF / Scan / Image
↓
Textract
↓
Text
Handwriting
Form
Table
Invoice / Form
↓
Textract
↓
Name
DOB
Invoice Number
Amount

Textract is more powerful than basic OCR because it can be understood forms and tables, not just reading words.

Simple flow

Image / Video
↓
Rekognition
↓
Visual Analysis
PDF / Scan
↓
Textract
↓
Structured Data

4. Practical example

An application receives invoice images, extracts fields with Textract, and validates the results against business rules.

User Upload Image
↓
Rekognition
↓
Content Moderation
Invoice / ID / Form
↓
Textract
↓
Extract Fields
↓
Application / Database

5. Comparison

Rekognition identifies visual content; Textract focuses on extracting document information.

Amazon Transcribe, Polly & Translate

1. Concept

Transcribe converts speech to text, Polly converts text to speech, and Translate translates text.

2. Purpose

Automate speech, text, and language conversions in applications.

3. How it works

  • These are available ML services for speech and language processing, without the need to train the model yourself.
Transcribe
= Speech → Text

Polly
= Text → Speech

Translate
= Text in language A → Text in language B

Amazon Transcribe

  • Amazon Transcribe: Turns speech in audio files or calls into written text.
  • Example: Transcribe support calls for staff to search later, create captions, or make audio/video searchable.
  • Language identification: Automatically identifies the spoken language when supported.
  • PII redaction: Masks supported personal information in transcripts, such as phone numbers or other sensitive details.
Audio / Voice
↓
Transcribe
↓
Text Transcript
Customer Call
↓
Transcribe
↓
Call Transcript

Amazon Polly

  • Polly converts text to speech.
Text
↓
Polly
↓
Speech Audio
"Welcome to our application"
↓
Polly
↓
🔊 Voice
  • Reading can be customized with: Lexicon = correct the pronunciation of word / name / acronym
  • SSML = adjust pronunciation / emphasis / speaking style

Polly = Text-to-Speech.

Amazon Translate

  • Translate is used to translate text between languages.
English Text
↓
Translate
↓
Vietnamese Text
  • Suitable for: Website localization · Product description · Notification · Multilingual Application

Combined flow

Three services can be combined together:

Customer Call
↓
Transcribe
↓
Text
↓
Translate
↓
Other languages
↓
Polly
↓
Speech
English Voice
↓
Transcribe
↓
English Text
↓
Translate
↓
Vietnamese Text
↓
Polly
↓
Vietnamese Voice

4. Practical example

Training videos receive transcripts from Transcribe, translations from Translate, and optional spoken translations from Polly.

Video / Call
↓
Transcribe
↓
Subtitle / Transcript
Application Text
↓
Polly
↓
Voice / Accessibility
Website Content
↓
Translate
↓
Multi-language Website

5. Comparison

Choose by input and output type: audio, text, or target language.

Amazon Lex & Amazon Connect

1. Concept

Lex builds chat or voice bots; Connect provides contact-center infrastructure and customer-service flows.

2. Purpose

Automate customer intake and route requests to appropriate bots or agents.

3. How it works

  • Amazon Lex is used to create chatbots/voice bots that understand user intentions, while Amazon Connect is a cloud contact center to receive calls and coordinate contact flow.
  • Lex = understand speech/text = recognize intent
  • Connect = receive calls = coordinate contact flow

Amazon Lex

Lex uses:

ASR
= Speech → Text

NLU
= understand what the user wants to do

For example:

"I want to make an appointment for tomorrow"
↓
Lex
↓
Intent = BookAppointment

Intent = user intent, not just keywords.

  • Lex is suitable for: Chatbot · Voice Bot · Call Center Bot

Amazon Connect

  • Amazon Connect is cloud contact center.
Caller
↓
Amazon Connect
↓
Contact Flow
↓
Bot / Agent / Backend
  • Connect can: Receive calls · Route calls · Create contact flow · Switch to agent · Integrate CRM / AWS services

Connect + Lex + Lambda

Popular flows:

Caller
↓
Amazon Connect
↓
Amazon Lex
↓
Intent identification
↓
Lambda
↓
CRM/Backend

Scheduling example:

"I want to book a 3pm appointment"
↓
Connect
↓
Lex
→ Intent = BookAppointment
↓
Lambda
↓
CRM
↓
Create appointment

When the Bot cannot handle it

Lex confidence is low
or
case has not been designed yet
↓
Fallback
↓
Human Agent
  • Lex understands the request: The bot identifies what the user wants, such as changing a delivery address; it does not decide whether the user is authorized.
  • Backend checks: Validate input, user permissions, and business rules before changing data.
  • Avoid repeated actions: If a user or system resends the request, the backend should recognize it to avoid duplicate orders or payments.

4. Practical example

A customer calls Connect; Lex collects an order ID, Lambda retrieves its status, and an agent takes over when needed.

Customer Call
↓
Connect + Lex
↓
FAQ / Booking / Order Status
Simple request
↓
Processing bot

Complex request
↓
Human Agent

5. Comparison

Lex identifies intents and collects slots; Connect manages calls, routing, and agent interactions.

Amazon Comprehend & Comprehend Medical

1. Concept

Comprehend identifies information and meaning in text; Comprehend Medical extracts supported medical information.

2. Purpose

Extract entities, sentiment, and language insights instead of manually reading all text.

3. How it works

  • Amazon Comprehend uses NLP to analyze text and find insights, and Comprehend Medical uses NLP for clinical/medical text.
  • Comprehend = NLP for regular text
  • Comprehend Medical = NLP for medical text

Amazon Comprehend

  • Comprehend can find: Language · Key Phrases · Entities · Sentiment · Topics

For example:

Customer Review
↓
Comprehend
↓
Sentiment = Negative
Entity = Product X
Key Phrase = "slow delivery"

Suitable for:

Review
Email
Article
Document
↓
Search / Filter / Group by topic

Comprehend Medical

Used for unstructured medical text:

  • Doctor Notes · Discharge Summary · Test Results · Case Notes
Clinical Text
↓
Comprehend Medical
↓
Medical Information / Entities

DetectPHI

  • DetectPHI = detect sensitive medical information
  • Patient Name · Address · Phone · Medical ID

DetectPHI helps detect PHI, but does not replace the security/compliance process.

Simple flow

Email / Review
↓
Comprehend
↓
Sentiment / Entity / Topic
Patient Audio
↓
Transcribe
↓
Text
↓
Comprehend Medical
↓
Medical Data / PHI

4. Practical example

A support team uses sentiment analysis to prioritize negative feedback for review.

Customer Reviews
↓
Comprehend
↓
Sentiment Analysis
Large Document Collection
↓
Comprehend
↓
Group by Topic
Clinical Document
↓
Comprehend Medical
↓
Detect PHI

5. Comparison

Textract extracts document text; Comprehend analyzes existing text; the Medical service specializes in medical contexts.

Amazon SageMaker AI

1. Concept

SageMaker AI helps build, train, and deploy custom machine learning models, such as a sales forecasting model.

2. Purpose

Build and operate custom models when prebuilt AI APIs do not meet requirements.

3. How it works

  • Amazon SageMaker AI is a managed service to build, train, tune, and deploy custom Machine Learning models.
  • SageMaker = Build ML Model = Train = Tune = Deploy = Predict

Different from available AI services such as Translate or Textract:

  • Translate / Textract = ready-made AWS model
  • SageMaker = you train your own model for your own problem

Basic ML Flow

Historical Data
↓
Features + Labels
↓
SageMaker Training
↓
Model
↓
New Data
↓
Prediction

For example:

Historical Students
↓
Study Time + Experience
↓
Exam Result
↓
Train Model
↓
New Student
↓
Predict Pass / Fail

Training Data

  • Training usually requires: Features = input information
  • Label = result needs model to learn
Study Hours
AWS Experience
IT Experience
↓
Features

Exam Score
↓
Label
  • The model learns the relationship between features and labels to predict new data.

Train / Tune / Deploy

  • Train = model learned from historical data
  • Tune = try configurations to get a better model
  • Deploy = send the model to the endpoint for the application to call
Train
↓
Tune
↓
Model Artifact
↓
Deploy Endpoint
↓
Application
↓
Prediction

Managed but still have to check the model

SageMaker manages the infrastructure, but the model still depends on:

  • Training Data · Feature · Label · Model Quality

If data is wrong:

Bad Data
↓
Bad Model
↓
Bad Prediction
  • Also need monitor: Model Quality · Data Drift · Prediction Quality

4. Practical example

A retailer trains a demand model on its own data and runs inference in batches or through an endpoint.

Customer History
↓
SageMaker
↓
Churn Prediction
Transaction Data
↓
SageMaker
↓
Fraud Risk Score
Sales History
↓
SageMaker
↓
Demand Forecast

5. Comparison

  • SageMaker AI supports custom models; prebuilt AI APIs such as Textract provide capabilities without building the underlying general model.

SageMaker Batch Transform vs Real-Time Endpoint

Inference modeMechanisms & Use Cases
SageMaker Batch TransformRun offline batch inference on large data sets stored in S3 and then write the results to S3, automatically turn off compute when the job is finished — used when immediate results are not needed for each request (not used for ETL data cleaning)
SageMaker Real-Time EndpointMaintain a continuously running HTTPS endpoint to deliver predictable low latency (milliseconds) for each online request
Amazon Kendra & Amazon Personalize

1. Concept

Kendra searches internal documents for answers; Personalize recommends content or products from user behavior.

2. Purpose

Find relevant documents or recommend content suited to individual users.

3. How it works

  • Amazon Kendra is used to search and find answers in documents, while Amazon Personalize is used to suggest suitable content/products for each user.
  • Kendra = Intelligent Document Search
  • Personalize = Recommendation Engine

Amazon Kendra

  • Amazon Kendra: Searches an organization's documents using everyday questions rather than requiring exact keywords.
  • Example: Ask “Where do I contact IT support?” to find the answer in internal documents.
  • Sources: Can connect to supported sources such as S3, RDS, Google Drive, SharePoint, OneDrive, Salesforce, and ServiceNow.
  • Content: Searches indexed documents such as PDFs, Word files, HTML, and FAQs.
Documents
↓
Kendra Index
↓
User Question
↓
Relevant Answer / Result
"Where is the IT support desk?"
↓
Kendra
↓
Find the answer in internal documentation

Amazon Personalize

  • Personalize uses user behavior to create recommendations.
User / Item / Interaction Data
↓
Personalize
↓
Recommendation
User buys Gardening Tools
↓
Personalize
↓
suggestion:
Seeds
Gloves
Watering Can
  • Can be used for: Website · Mobile App · Email · SMS

In addition to recommending items, Personalize can also:

  • Re-rank list = reorder the list according to each user

4. Practical example

Employees search leave policies through Kendra; a shopping site recommends products through Personalize.

Company Documents
↓
Kendra
↓
Employee Search
FAQ / PDF / Knowledge Base
↓
Kendra
↓
Customer Support Search
User Purchase / Click History
↓
Personalize
↓
Product Recommendation

5. Comparison

Enterprise search retrieves information relevant to a query; recommendations rank content for individual users.

Kendra vs Personalize

Kendra = "What information is the user looking for?"

Personalize = "What item should this user see next?"

Documents
↓
Kendra
↓
Search / Answer
User Behavior
↓
Personalize
↓
Recommendation

Monitoring, Audit & Observability

Amazon CloudWatch: metrics, logs, alarms & insights

1. Concept

CloudWatch collects metrics and logs to show how systems are running and alert on configured conditions.

2. Purpose

Amazon CloudWatch is used to monitor the AWS system with metrics, logs, dashboards and alarms.

3. How it works

  • CloudWatch = Metrics + Logs + Dashboard + Alarms
  • It replied: "How is the system running?"
  • Other than: CloudTrail = who called which AWS API?

Functional groups and EventBridge

Functional groupWhat to use?
MetricsCollect measurements over time: CPU, latency, request count
LogsCentralize application/service logs
DashboardsDisplays graphs and system status
AlarmsMonitor conditions/status for alerts or action calls
InsightsAnalyze logs and observe specialized workloads such as containers/Lambda
CloudWatch Events → Amazon EventBridgeReceive events, use filtering rules and pass to targets like Lambda/SQS
  • These are functional groups, not mutually exclusive types of monitoring. CloudWatch Events is the former name of Amazon EventBridge; Alarm tracks metrics, EventBridge routes events such as EC2 state changes or state change alarms.

CloudWatch Metrics

  • Metric = a value measured over time.

For example:

  • CPUUtilization · NetworkIn · RequestCount · ErrorCount
EC2 / Lambda / RDS...
↓
Metrics
↓
CloudWatch
↓
Dashboard / Alarm

Namespace & Dimension

  • Namespace: A group for a service or application's metrics, such as AWS/EC2, AWS/Lambda, or AWS/RDS.
  • Dimension: Information distinguishing a particular resource's metrics, such as InstanceId = i-123456.
  • Example: Two EC2 instances both report CPUUtilization, but InstanceId lets you view each instance's CPU separately.

EC2 granularity and RDS metrics

Resources/modeGranularityData
EC2 Basic Monitoring5 minutes for most metrics; status checks 1 minuteEC2 metrics default
EC2 Detailed Monitoring1 minuteEC2 metrics; Need to turn on, there is a fee
Default RDS CloudWatch1 minuteDatabase metrics; No need for EC2 Detailed Monitoring
RDS Enhanced MonitoringCan be down to 1 secondOS/process metrics → CloudWatch Logs; Need to enable and monitor role
  • EC2 RAM needs Agent/custom metric. Enhanced Monitoring collection 1 second does not mean the RDS console refreshes every second. ·

Custom Metrics

  • You can manually send metrics to CloudWatch.

Important examples:

Default EC2
→ has CPU / Network...

RAM Usage
→ no default
→ need Agent / Custom Metric

CloudWatch Dashboard

Metrics / Logs
↓
CloudWatch Dashboard
↓
Graph / Chart / Status
  • Dashboard example: CPU · Memory · Request Count · Errors · Latency

CloudWatch Logs

  • CloudWatch Logs is used to centralize logs from application/service.
  • Popular sources: Lambda · ECS · API Gateway · VPC Flow Logs · CloudTrail · EC2 · On-premises
1. EC2 / On-premises
  • Logs are not automatically sent to CloudWatch.
EC2
↓
CloudWatch Agent
↓
CloudWatch Logs
  • Agents need: Config + IAM Permission

CloudWatch Logs Insights

  • Logs Insights = query/search log saved in CloudWatch Logs.
CloudWatch Logs
↓
Logs Insights
↓
Filter / Search / Aggregate
  • Find ERROR · Count requests · Find IP · View latest log
  • Query example: fields @timestamp, @message · | sort @timestamp desc · | limit 20

Logs Insights = historical query log, not streaming engine.

Put Logs out

  • There are 2 easy ways to remember.
1. S3 Export
CloudWatch Logs
↓
Export Task
↓
S3
  • = Batch = not for real-time
2. Subscription Filter
CloudWatch Logs
↓
Subscription Filter
↓
Kinesis / Firehose / Lambda
  • = near real-time
CloudWatch Logs
↓
Subscription Filter
↓
Firehose
↓
S3 / OpenSearch

CloudWatch Agent

1. Logs Agent
  • Old Agent = only sends logs
2. Unified Agent
  • Unified Agent = Logs + System Metrics
  • You can get more: RAM · Disk · Processes · Swap · Network · Detailed CPU
EC2
↓
Unified Agent
↓
RAM + Disk + Logs
↓
CloudWatch

Metric Streams

  • Metric Streams are used to send metrics continuously to other systems.
CloudWatch Metrics
↓
Metric Stream
↓
Data Firehose
↓
S3 / Redshift / OpenSearch

Or:

CloudWatch
↓
Datadog / New Relic / Splunk...

Metric Stream = stream metrics out in near real-time.

CloudWatch Alarms

  • Alarm monitors a metric and triggers action when a threshold is exceeded.
Metric
↓
CloudWatch Alarm
↓
Threshold is overtaken
↓
Action
CPU > 80%
↓
ALARM
↓
SNS Notification
  • Alarm has 3 states: OK · ALARM · INSUFFICIENT_DATA
  • Actions can be: SNS · Auto Scaling · EC2 Stop · EC2 Reboot · EC2 Recover

Composite Alarm

  • Composite Alarm combines multiple alarms.
CPU Alarm
AND
Disk IOPS Alarm
↓
Composite Alarm
↓
Incident

Purpose:

  • Reduce alarm noise

Composite Alarm does not measure new metrics, it only looks at the status of other alarms.

Logs → Metric → Alarm

  • Logs can be turned into metrics.
Application Logs
↓
Metric Filter
↓
ERROR Count Metric
↓
Alarm
↓
SNS

EC2 Status Check & Recovery

  • EC2 has status checks such as: Instance Status = problem inside VM
  • System Status = underlying problem AWS host
  • EBS Status = attached storage problem
StatusCheckFailed_System
↓
CloudWatch Alarm
↓
EC2 Recover
  • → AWS moves the instance to more powerful hardware.

CloudWatch Insights

  • Some specialized features: Container Insights = monitor ECS / EKS / Containers
  • Lambda Insights = detailed Lambda monitor
  • Contributor Insights = find top contributors like the IP sending the most traffic/errors
  • Application Insights = monitor application and dependency
  • No need to remember too much, just remember that these are specialized monitoring tools of CloudWatch.

Network Monitor

  • Used to monitor the network between AWS and on-premises.
  • AWS · ↕ · Direct Connect / VPN · ↕ · On-premises
  • Follow: Latency · Packet Loss · Jitter

Overall flow

AWS Resources / Application
↓
Metrics + Logs
↓
CloudWatch
↓
Dashboard / Logs Insights
↓
Alarm
↓
SNS / Auto Scaling / EC2 Action

4. Practical example

An ALB returns excessive 5xx errors; a CloudWatch alarm notifies operations to inspect related logs.

EC2
↓
Unified Agent
↓
RAM / Disk / Logs
↓
CloudWatch
↓
Alarm
Application Logs
↓
CloudWatch Logs
↓
Logs Insights
↓
Troubleshooting
Logs
↓
Subscription Filter
↓
Firehose
↓
OpenSearch
CPU + IOPS Alarm
↓
Composite Alarm
↓
SNS

5. Comparison

CloudWatch observes operations; CloudTrail audits APIs; Config tracks configuration state and compliance.

Alarm Actions, Dashboard Sharing, Cross-Account OAM & Distinguishing Access Logs

CloudWatch featureMechanism of action
CloudWatch Alarm ActionsActivate SNS, Auto Scaling, Lambda, EC2 Actions (Reboot, Recover Go to a new physical host to keep the same IP/EBS when hardware fails, Stop, Terminate) and create SSM OpsItem / Incident
CloudWatch Dashboard SharingShare dashboard to outsiders via public link, specified email/password or SSO without creating an IAM User in the account (Logs widgets are hidden by default unless permissions are enabled)
CloudWatch Cross-Account OAM (Observability)Create OAM Sink at Monitoring Account and deploy OAM Link (automation via CloudFormation StackSets) in Source Accounts to centralize Metrics, Logs and Traces
ServiceLog TypeRecorded content
CloudTrailAPI Activity LogsWho calls which AWS API, when, from which IP
VPCVPC Flow LogsIP packet metadata (Source/Dest IP, Port, Protocol, ACCEPT/REJECT — does not contain HTTP body)
ALB / NLB / API Gateway / CloudFrontAccess LogsHTTP/HTTPS request details or TLS connection at the distribution/load balancing layer
S3Server Access LogsDetails of each object-level access request to the bucket
AWS WAFWAF LogsWeb traffic that matches the Allow, Block or Count rule
Amazon EventBridge

1. Concept

EventBridge receives events, filters them with rules, and routes them to services that should react.

2. Purpose

Amazon EventBridge is a serverless event bus used to receive events, filter events, and automatically send events to other services.

3. How it works

  • EventBridge = receive event + filter event + route event to target
"Something happened"
↓
EventBridge detected
↓
"Then do something"

Basic Flow

Event Source
↓
EventBridge Bus
↓
Rule
↓
Target

For example:

EC2 is stopped
↓
EventBridge
↓
Rule match
↓
Lambda / SNS / SQS

Rule decides when to run, Target is the service that actually works.

Event Source

  • EventBridge can receive events from: AWS Services · SaaS Applications · Custom Applications · CloudTrail
  • EC2 state change · S3 event · CodeBuild failed · CloudTrail API call · Custom application event

Rule

Rules have 2 main types:

1. Event Pattern
  • Runs when an event meets the conditions.
Event occurs
↓
Rule checks JSON
↓
Match?
↓
Target
EC2 State = stopped
↓
EventBridge Rule
↓
SNS Alert
2. Schedule / Cron
  • Run over time.
Every 1 hour
↓
EventBridge
↓
Lambda
00:00 every day
↓
EventBridge
↓
Lambda cleanup temporary files

Target

  • Target is the service that handles events after the rule match.
  • Could be: Lambda · SQS · SNS · Step Functions · ECS · AWS Batch · Kinesis · CodePipeline · CodeBuild · SSM
Order Created
↓
EventBridge
↓
SQS
↓
Order Worker

Event Bus

  • EventBridge has the following bus types: Default Event Bus = AWS service events
  • Partner Event Bus = SaaS like Datadog/Zendesk
  • Custom Event Bus = event from your application
My Application
↓
Custom Event Bus
↓
Rule
↓
Lambda

Producer & Consumer separate

EventBridge key points:

Producer
↓
EventBridge
↓
Consumer
  • The producer does not need to know who handles the event.
Order Service
↓
"OrderCreated"
↓
EventBridge
├── Inventory Lambda
├── Email SQS
└── Analytics Kinesis

Order Service only broadcasts events, no need to call each service directly.

CloudTrail + EventBridge

  • CloudTrail records AWS API activity.
  • EventBridge can react to those events.
User calls DeleteTable
↓
CloudTrail records
↓
EventBridge Rule match
↓
SNS
↓
Security Team

Or:

Root Login
↓
EventBridge
↓
SNS Alert

EventBridge react after the event occurs, do not block previous API calls.

Archive & Replay

  • Archive: Stores EventBridge events for later use.
  • Replay: Sends stored events again, such as testing a new consumer or reprocessing after a fix.
  • Consumer: Still needs retry and duplicate-effect handling because an old event may be processed again.
Event Bus
↓
Archive
Archive
↓
Replay
↓
Rule / Target

Replay does not replace consumer idempotency/retry logic.

Schema Registry

  • Schema Registry = saves/understands the event JSON structure

Event example:

{
  "orderId": "123",
  "status": "PAID"
}
  • Schema helps the application know what fields the event has.

Cross-account

  • EventBridge can send events between AWS accounts.
Account A
↓
EventBridge
↓
Account B Central Event Bus
  • Suitable for: Multi-account AWS Organization · Central Monitoring · Central Security Automation
  • Need: IAM Permission + Event Bus Resource Policy

4. Practical example

An order-cancellation event triggers a refund workflow without the order service directly calling every system.

Every 1 hour
↓
EventBridge
↓
Lambda
EC2 State Change
↓
EventBridge
↓
SNS Alert
CloudTrail DeleteTable
↓
EventBridge
↓
Security Notification
OrderCreated
↓
EventBridge
↓
SQS / Lambda / Step Functions

5. Comparison

An event bus routes events; Scheduler triggers time-based work; SQS holds messages for consumers.

AWS CloudTrail

1. Concept

CloudTrail records API activity and selected events to show who did what in AWS.

2. Purpose

AWS CloudTrail is used to audit activity in an AWS account.

3. How it works

  • It replied: Who? · Doing what? · When? · From where?

For example:

EC2 is terminated
↓
CloudTrail
↓
Which User/Role calls the API?
Which IP?
What time?
Which API?

CloudTrail = audit AWS API activity.

What does CloudTrail record?

  • CloudTrail records activity from: AWS Console · CLI · SDK · AWS Services · IAM User / Role
  • CreateSubnet · DeleteBucket · TerminateInstances · AttachRolePolicy

Event History

  • CloudTrail does Event History default for management events.
  • Event History = see recent activity = keep for about 90 days

If you need to save longer:

CloudTrail Trail
↓
S3
↓
Athena query

Trail

  • Trail = configure CloudTrail to send long-term logs to storage.
CloudTrail
↓
Trail
↓
S3
  • You can send more to: CloudWatch Logs
  • Trails can: Single Region · or · All Regions

Types of Events

1. Management Events
  • Is an AWS resource management operation.
  • CreateSubnet · AttachRolePolicy · CreateTrail · TerminateInstances
  • Can be divided: Read = read only
  • Write = change resources

Management events are the most common type when investigating who edited/deleted a resource.

Data Events

  • Is an activity directly on data/object/function.
  • S3 GetObject · S3 PutObject · S3 DeleteObject · Lambda Invoke
  • Data events: High volume · Higher cost · No default logging
  • So it's usually only enabled for important resources.

CloudTrail Insights

  • CloudTrail Insights is used for discovery unusual activity.
Normal:
10 API calls/minute

Suddenly:
1000 API calls/minute
↓
CloudTrail Insights
↓
Anomaly
  • Can detect: Abnormal IAM activity · Abnormal Provisioning · API burst · Behavior different from baseline
Management Write Events
↓
CloudTrail Insights
↓
Detect anomaly
↓
EventBridge / Alert

Investigation with S3 + Athena

If saving CloudTrail to S3:

CloudTrail
↓
S3
↓
Athena
↓
SQL Query
  • Example you want to find: Who deletes bucket? · Who terminates EC2? · Who edits Security Group?

CloudTrail + EventBridge

  • CloudTrail logs events.
  • EventBridge can react to that event.
User calls DeleteTable
↓
CloudTrail records
↓
EventBridge matches
↓
SNS/Lambda/SQS

CloudTrail = record

EventBridge = response

Overall flow

User / Role / AWS Service
↓
API Call
↓
CloudTrail
↓
Management / Data / Insights Event
↓
Event History / S3 / CloudWatch Logs
↓
Athena / EventBridge
↓
Investigation / Alert / Automation

4. Practical example

After a security group is opened, security investigates the API call, identity, and time in CloudTrail.

EC2 is terminated
↓
CloudTrail
↓
Find user + API + IP + time
Sensitive S3 Bucket
↓
Enable Data Events
↓
Log GetObject / PutObject / DeleteObject
CloudTrail
↓
S3
↓
Athena
↓
Long-term audit
Sensitive API Call
↓
CloudTrail
↓
EventBridge
↓
SNS Alert

5. Comparison

  • CloudTrail shows who did what;
  • CloudWatch shows how systems operate;
  • Config shows how configurations changed.

CloudTrail vs CloudWatch

CloudTrail = who did what on AWS?

CloudWatch = How is the system working?

EC2 is deleted
→ CloudTrail

EC2 CPU = 95%
→ CloudWatch
AWS Config & compliance automation

1. Concept

AWS Config records resource configuration over time and checks it against configured rules.

2. Purpose

AWS Config is used to monitor the configuration of AWS resources over time and check whether the resource complies with the rules or not.

3. How it works

  • AWS Config = Configuration History + Compliance Check
  • It replied: How are resources configured? · What was the previous configuration like? · Is it compliant with the rule?

Easy to understand example

  • You have rule: Security Group · do not open SSH 22 for 0.0.0.0/0
  • If there is SG: Port 22 · Source = 0.0.0.0/0
  • Config rating: NON_COMPLIANT ❌
  • If only for corporate IP: Port 22 · Source = Company IP

→

COMPLIANT ✅

Config = check if the configuration has the correct policy.

What does AWS Config track?

For example:

  • Security Group · S3 Bucket · EC2 · EBS · ALB · IAM · ...
  • May know: Current configuration · Previous configuration · When the configuration changed · Compliance status

Resource Timeline

  • Config saves the resource's change history.
  • 10:00 · S3 Bucket = Private · 11:00 · S3 Bucket = Public · 12:00 · S3 Bucket = Private
  • Config Timeline helps view: When do resources change · Configuration before/after · How compliance changes
  • Can link to CloudTrail to see which API call caused the change.

Config Rules

  • Rule is used to check configuration.
S3 Buckets
→ cannot be Public

Security Group
→ Do not open SSH all over the Internet

ALB
→ must have SSL Certificate
  • There are 2 types: AWS Managed Rule = Ready-made AWS
  • Custom Rule = your own logic = usually use Lambda

When does the rule run?

Can run:

Configuration Change
↓
Config evaluate immediately

or:

According to Schedule
↓
Config checked periodically
EC2 configuration changes
↓
Config Rule
↓
COMPLIANT / NON_COMPLIANT

Config DOES NOT block changes

Very important point:

User opens S3 Public
↓
Action happened first
↓
Config detected
↓
NON_COMPLIANT

Config detects after configuration occurs, not firewall to block previous action.

Notification

Khi resource NON_COMPLIANT:

AWS Config
↓
EventBridge / SNS
↓
Alert
Security Group opens port 22
↓
Config = NON_COMPLIANT
↓
EventBridge
↓
SNS
↓
Security Team

Auto Remediation

  • Config can automatically edit resources through SSM Automation.
NON_COMPLIANT
↓
AWS Config
↓
SSM Automation
↓
Fix configuration
IAM Access Key expired
↓
Config
↓
NON_COMPLIANT
↓
SSM Automation
↓
Revoke Key

Remediation requires appropriate IAM permission.

Multi-Account / Multi-Region

AWS Config works by Region but can be aggregated:

Account A / Region A
Account B / Region B
Account C / Region C
        ↓
Config Aggregator
        ↓
Central Security Account
  • Great for managing compliance for multiple AWS accounts.

S3 + Athena

Config data can be saved to S3:

AWS Config
↓
S3
↓
Athena
↓
SQL Analysis / Report
  • Used for long-term audit.

Combined example

Assuming Security Group is opened:

0.0.0.0/0 → Port 22
1. CloudTrail
Who fixed SG?
↓
User A
AuthorizeSecurityGroupIngress
2. AWS Config
Current SG:
Port 22 opens to the Internet
↓
NON_COMPLIANT
3. CloudWatch
  • Monitor application/server metrics · CPU / Logs / Errors

AWS Config Aggregator (Multi-Account / Multi-Region)

Member Accounts (AWS Config enabled in each Region)
  ↓ Collect about
Security / Management Account (AWS Config Aggregator)
  ↓ Centralized Dashboard: Resource Inventory + Configuration History + Compliance Status
  • Config Aggregator only display synthesis and compliance testing; does not replace CloudTrail and does not automatically edit resources or create landing zones for new accounts.

4. Practical example

Config detects a noncompliant bucket and a configured remediation restores the required setting.

S3 Bucket
↓
Config
↓
Check Public Access
Security Group
↓
Config
↓
Check unrestricted SSH
NON_COMPLIANT
↓
EventBridge / SNS
↓
Security Alert
NON_COMPLIANT
↓
SSM Automation
↓
Auto Remediation

5. Comparison

Config evaluates changes; preventive controls such as SCPs restrict actions before they occur.

CloudWatch vs CloudTrail vs Config

  • CloudWatch: How is the system running? Examples include high CPU, slow responses, or many failed requests.
  • CloudTrail: Who did what? Examples include changing a security group, deleting EC2, or calling an API.
  • AWS Config: How is a resource configured, and does it meet your rules? Examples include port 22 open to the Internet or a public S3 bucket.

Compare options

AWS X-Ray & Amazon Managed Grafana

1. Concept

X-Ray traces a request across services; Managed Grafana brings monitoring data into visual dashboards.

2. Purpose

Distributed trace of each request across a microservices architecture and visualize multi-source monitoring data on a unified dashboard.

3. How it works

  • Applications send traces to X-Ray; Grafana queries configured data sources to display dashboards.
  • Configure appropriate instrumentation, connectivity, and access permissions.

4. Practical example

A slow API trace identifies a costly database step, while related metrics appear in Grafana.

5. Comparison

Traces follow an individual request; metrics aggregate measurements; logs record detailed events.

AWS X-Ray & Amazon Managed Grafana Distinguishing Table

ServiceCore roleCentralized Integration & Configuration
AWS X-RayDistributed Tracing: records segments/subsegments and builds Service Map end-to-end to accurately localize services causing bottlenecks or 4xx/5xx errorsAPI Gateway, Lambda, ECS, EC2, SQS, SNS, DynamoDB, RDS integration; enabled via IaC (TracingConfig: Active on Lambda, TracingEnabled: true on API Gateway) with IAM permission to write trace
Amazon Managed GrafanaCompletely managed visual dashboard (no need to operate the Grafana server yourself)Concurrent queries from CloudWatch, Managed Prometheus, X-Ray, OpenSearch, Timestream, Athena, RDS; SSO login via IAM Identity Center

Security, Encryption & Threat Detection

AWS encryption patterns & KMS

1. Concept

Encryption makes data unreadable without a key; KMS manages keys and permission to use them.

2. Purpose

Understand the three places where encryption occurs and how AWS KMS manages encryption keys.

3. How it works

  • In Transit = encryption during transmission
  • At Rest = encryption at rest
  • Client-Side = the client encrypts itself before sending

Encryption in Transit

TLS / SSL
↓
HTTPS
Client
↓ encryption
Internet
↓
AWS Service
↓ decryption
Data
  • Protection from: Eavesdropping · Man-in-the-Middle
  • Certificates help clients authenticate endpoints.

Server-Side Encryption

  • The service automatically encrypts data before saving.
Client
↓ HTTPS
S3 / EBS / RDS
↓
Encrypt
↓
Ciphertext
↓
Storage

When reading:

Storage
↓
Decrypt
↓
Client
  • AWS services used KMS key/data key to perform encryption.

Client-Side Encryption

The client encrypts itself first:

Client
↓ Encrypt
Ciphertext
↓
S3 / DynamoDB / Storage
  • Storage only holds: Ciphertext
  • Only the client with the key can decrypt.

This is a stronger layer of protection if you want data to remain encrypted even for storage service administrators.

AWS KMS

  • KMS = manage encryption keys + control key usage + audit key usage
  • KMS integrates with: S3 · EBS · RDS · SSM · CloudTrail · IAM · ...
  • The application does not retrieve the plaintext KMS key.
Application
↓ KMS API
Encrypt/Decrypt
↓
KMS performs crypto operations

KMS Key Types

  • Symmetric = same key to Encrypt / Decrypt = commonly used AWS service
  • Asymmetric = Public Key + Private Key = Encrypt/Verify with public = Decrypt/Sign with private
  • Key types by ownership: AWS Owned Key = Fully managed by AWS
  • AWS Managed Key = AWS managed = alias of the form aws/service-name
  • Customer Managed Key = customer lifecycle management + policy = most detailed control

Customer Managed Key Suitable when you need custom key policy, cross-account, audit or lifecycle control.

Key Policy

  • Key policy: Defines who may manage or use a KMS key.
  • IAM policy: Does not guarantee key access by itself; the key policy must allow access directly or enable the account to delegate appropriate access through IAM.
  • Example: Role A needs permission to use kms:Decrypt on that key.
  • Cross-account access: Requires appropriate permissions in both the owner's key policy and the caller's IAM policy.
Key Policy
↓
Allow Role A
↓
kms:Decrypt

Rotation

AWS Managed Keys
→ AWS self-rotates

Customer Managed Key
→ automatic rotation can be enabled
  • Imported key material has different rotation limits.

KMS Key by Region

  • KMS key is Regional resource.
  • Region A · KMS Key A · Region B · KMS Key B

When copying encrypted snapshot to another Region:

Decrypt with Key A
↓
Encrypt with Key B
↓
Snapshot in Region B

Multi-Region Key

  • Multi-Region key: Related KMS keys in multiple Regions, with one primary key and replica keys.
  • Shared properties: They have the same key ID, key material, and rotation properties.
  • Example: An application encrypts data in Region A and uses the corresponding replica key to decrypt it in Region B.
  • Management: Each key is still managed in its own Region; this is not one global resource sharing every setting.

4. Practical example

An application stores records in S3 with SSE-KMS and grants decryption only to its processing role.

  • SSE-KMS for S3/EBS/RDS when needing CloudTrail audit, key policy and revoke access by key.
  • Client-side encryption for SSN/PII before replicating via DynamoDB Global Tables or Aurora Global Database.
  • Customer managed key and key policy have conditions to share encrypted snapshot/AMI for DR account.

5. Comparison

  • TLS protects data in transit;
  • encryption at rest protects stored data;
  • client-side encryption encrypts before uploading.

Compare 3 types of KMS Key, BYOK vs XKS & Default Encryption by Service

CriteriaAWS Owned KeyAWS Managed Key (alias/aws/...)Customer Managed Key (CMK)
Visible in KMS & CloudTrail?NoYesYes
Edit Key Policy / Cross-Account Sharing?NoNoYes (full control over rotation, policy, key deletion)
Locking costsFreeFree key maintenance (API fees may apply)Monthly key maintenance fee + API call fee
CriteriaBYOK (Import Key Material)XKS (External Key Store)
Key Material location of KMS KeyBorn outside import into AWS KMSAlways outside of AWS (on HSM on-premises), never import into AWS
Encryption Enforcement & Network DependencyAWS KMS processes itself, no need for constant on-prem connectionAWS KMS calls out to the external key system via XKS Proxy (loss of connection interrupts decryption)
Service groupList to remember when doing homework
Default encryption availableAmazon S3 (SSE-S3), DynamoDB (AWS Owned Key), SQS (SSE-SQS on new queue), Secrets Manager, CloudWatch Logs, Aurora (newly created cluster) and EFS created via Console
Must be enabled/configured upon creationEBS (unless EBS Encryption by Default is enabled in Region), Regular RDS, SNS Topic, Kinesis Data Streams, ElastiCache and EFS created via CLI/API
SSM Parameter Store & AWS Secrets Manager

1. Concept

Parameter Store and Secrets Manager store configuration or secrets such as passwords outside source code.

2. Purpose

Save configuration and secret outside source code.

3. How it works

  • Parameter Store = mainly saves configuration + can save simple secret = hierarchy/path
  • Secrets Manager = secret management = automatic rotation

SSM Parameter Store

  • Parameter Store is used to save: Configuration · Application settings · Simple secrets

For example:

  • /app/dev/db-host · /app/dev/db-password · /app/prod/db-host · /app/prod/db-password
  • Advantages: Serverless · Scalable · Durable · Version history · IAM access control

Application gets parameters via API:

Application/Lambda
↓
GetParameters
or
GetParametersByPath
↓
Parameter Store
↓
Value

Parameter Types

Secret can be saved as:

SecureString
↓
Encrypt using KMS
Application Role
↓ IAM allowed
Parameter Store
↓
KMS Decrypt
↓
Application receives plaintext value
  • → helps avoid hard-coding passwords/secrets in source code.

Parameter Hierarchy

Parameters can be organized by path:

  • /my-app/dev/db-password · /my-app/prod/db-password
  • Can be used: GetParametersByPath; to get parameters in a path.
/my-app/prod/
↓
db-host
db-user
db-password

Combining IAM:

Production Lambda
↓
read only
/my-app/prod/*
  • → easy to apply least privilege.

Parameter Store Integrations

  • Parameter Store integrates with: IAM = control permissions
  • KMS = SecureString encryption
  • EventBridge = notification/event
  • CloudFormation = use parameter in template

AWS also offers public parameters:

  • /aws/service/ami-amazon-linux-latest/...
  • → example used to get the latest Amazon Linux AMI ID.

You can reference secrets in Secrets Manager via:

  • /aws/reference/secretsmanager/...
Application
↓ GetParameter
Parameter Store
↓ reference
Secrets Manager
↓
Secret
  • → The real secret is still inside Secrets Manager, Parameter Store only provides reference for reading.

Parameter Tiers

  • There are 2 tiers: Standard · Advanced

According to the slides:

StandardAdvanced
Parameters/account/Region10,000100,000
Max value4 KB8 KB
Parameter PoliciesNoYes
Storage feeFreeThere are fees

Quotas/pricing are subject to change. Check current AWS Service Quotas/Pricing.

Parameter Policies

  • Only available with: Advanced Parameters
1. Expiration
Parameters
↓
to the time of expiration
↓
Delete
  • → automatically delete the parameter when it expires.
2. ExpirationNotification
About to expire
↓
EventBridge notification
  • → warning before parameter expires.
3. NoChangeNotification
Parameters do not change
in X days
↓
EventBridge notification
Password
↓
90 days without change
↓
Alert
  • → useful for reminding to rotate old secrets.

AWS Secrets Manager

  • Secrets Manager specializes in: Passwords · Database credentials · API secrets
  • Secrets are: Encrypt using KMS
  • Strengths: Automatic Secret Rotation
Secret Manager
↓
Rotation
↓
Lambda
↓
Create a new password
↓
Update database
↓
Update secrets
  • Has integration with database such as: RDS · MySQL · PostgreSQL · Aurora

Multi-Region Secrets

Secrets Manager can replicate secrets:

Region A
Primary Secret
↓ replicate
Region B
Replica Secret
  • The replica is synchronized with the primary.

Possible:

Replica
↓
Promote
↓
Standalone Secret
  • → suitable for: Multi-Region · Disaster Recovery

Overall flow

Application Role
↓
IAM
↓
Parameter Store / Secrets Manager
↓
KMS Decrypt
↓
Value / Secret
↓ TLS
Application

4. Practical example

An application retrieves its RDS password from Secrets Manager with configured rotation instead of hardcoding it.

Configuration
↓
Parameter Store
Secret has changed little
↓
Parameter Store SecureString
Secret needs automatic rotation
↓
Secret Manager
Database credentials
Need to rotate automatically
↓
Secret Manager

5. Comparison

Parameter Store suits configuration and SecureString values; Secrets Manager focuses on secret lifecycles and rotation.

Parameter Store vs Secrets Manager

Parameter Store = config is main + simple secret = hierarchy/path = each update creates a new version

Suitable for:

Database endpoint
Feature flags
Log levels
App config
API keys rarely change
↓
Parameter Store

Secrets Manager = secret is key = manage rotation lifecycle = automatic secret rotation = matches database credentials

Database password
API credential
Secrets need to be changed periodically
↓
Secret Manager

Quick select:

Config / secret has changed little
↓
Parameter Store

Secret needs to rotate automatically
↓
Secret Manager
AWS Certificate Manager (ACM)

1. Concept

ACM issues and manages TLS certificates for encrypted connections such as HTTPS on integrated AWS services.

2. Purpose

Manage TLS certificates for HTTPS without having to handle the certificate lifecycle yourself.

3. How it works

  • ACM = provision certificate + deploy certificate + renew certificate
  • → used for protection encryption in transit.

ACM Certificate

  • ACM supports: Public Certificate · Private Certificate
  • Public certificate issued by ACM: Free + Automatic Renewal; as long as domain validation remains valid.

ACM Integrations

  • ACM integrates with: ALB / CLB / NLB · CloudFront · API Gateway Custom Domain
  • Certificate is attached at: TLS Termination

For example:

Client
↓ HTTPS
ALB + ACM Certificate
↓ TLS terminate
Application

Request Certificate

When requesting a certificate, declare the domain:

  • corp.example.com
  • or wildcard: *.example.com
  • Then you must verify domain ownership.
  • There are 2 ways: DNS Validation · Email Validation
1. DNS Validation
ACM
↓
CNAME validation record
↓
DNS / Route 53
↓
Domain verified
  • → best suited for automation.
2. Email Validation
ACM
↓
Validation email
↓
Domain contact
↓
Approve
  • Verification may take some time.

Certificate Renewal

With certificate issued by ACM:

ACM-issued Certificate
↓
Automatic Renewal
  • According to the slides: Renewal started · ≈ 60 days ago expiry; as long as validation is valid.

Imported Certificate

Certificate import from external CA:

Imported Certificate
↓
ACM does not renew itself

You must:

Renew outside
↓
Import the new certificate into ACM

ACM can send certificate expiry events via:

EventBridge

  • Daily expiry event · ≈ from 45 days ago expiry

Can be used:

AWS Config
↓
acm-certificate-expiration-check
  • to detect that the certificate is about to expire.

ACM with Load Balancer

ALB example:

Client
↓ HTTPS
ALB
↓ TLS Termination
ACM Certificate
↓
EC2 / Auto Scaling Group
  • Backend can receive: HTTP · or · HTTPS

Usually configured:

HTTP :80
↓ Redirect
HTTPS :443
  • → avoid letting the client continue to use plaintext HTTP.

ACM Certificate Region

Very important point:

CloudFront
+
Edge-Optimized API Gateway
↓
ACM Certificate in us-east-1

Also:

Regional API Gateway
↓
Certificate in the same Region as the API

With Load Balancer:

ACM Certificate
↓
same Region as Load Balancer

4. Practical example

A website terminates HTTPS at an ALB using an ACM certificate validated for its domain.

  • Route 53 DNS validation + ACM + ALB for web app HTTPS and HTTP→HTTPS redirect.
  • CloudFront distribution uses public ACM certificates in us-east-1.
  • Imported enterprise certificate with EventBridge/Config alert to operate manual renewal.

5. Comparison

ACM manages certificates; KMS manages encryption keys; imported certificates have different renewal responsibilities from ACM-issued certificates.

AWS CloudHSM

1. Concept

CloudHSM provides dedicated cryptographic hardware; you directly manage keys and HSM users.

2. Purpose

Use dedicated hardware HSM when customers need deeper control over keys, users, permissions and key material.

3. How it works

  • CloudHSM = dedicated Hardware Security Module = customer-specific hardware = customer key management + user + permission

HSM can be understood as:

"hardware safe"
↓
hold the cryptographic key
↓
Perform Encrypt/Decrypt/Sign
without giving out the plaintext key

What is CloudHSM?

  • CloudHSM: Dedicated hardware on AWS for protecting cryptographic keys. You control keys, HSM users, and permissions; AWS manages hardware and infrastructure.
  • Application access: Use the CloudHSM client/SDK to request encryption or signing; this is not a KMS API call by default.
  • Key protection: Cryptographic operations run inside the HSM; key material stays within the HSM in this usage pattern.
  • Capabilities: Supports encryption, signing, and cryptography such as AES, RSA, and ECC; hardware provides tamper resistance and FIPS compliance according to HSM type.
  • Cost: There is no free tier; use it when you need dedicated HSM control rather than only managing keys through KMS.
AWS manages
↓
HSM hardware
Physical infrastructure
Networking infrastructure
Customer management
↓
Cryptographic Keys
HSM Users
Permissions
Applications use HSM
Application
↓
CloudHSM Client Software
↓ SSL/TLS
CloudHSM Cluster
↓
HSM
Application
↓ requires Encrypt
CloudHSM Client
↓
HSM uses internal keys
↓
Ciphertext

CloudHSM Cluster

  • One cluster is a group of many HSMs working together.
CloudHSM Cluster
├─ HSM in AZ A
├─ HSM in AZ B
└─ HSM in AZ C

Purpose:

  • High Availability + Durability

If an AZ goes down:

AZ A HSM
↓ error

Application
↓
HSM in AZ B / AZ C
  • Differences with KMS: KMS = AWS Autonomous High Availability
  • CloudHSM = customer must design cluster and add HSM in multiple AZs

CloudHSM + KMS Custom Key Store

  • This is a very important concept.

Normal:

AWS Service
↓
KMS
↓
KMS manages key material

But with KMS Custom Key Store:

AWS Service
↓
KMS API
↓
KMS Custom Key Store
↓
CloudHSM Cluster
↓
Key Material
  • AWS Service = still call KMS as usual
  • KMS = still manages API, permission, key policy, audit
  • CloudHSM = holds the actual key material
EBS
↓ need to encrypt volume
KMS API
↓
Custom Key Store
↓
CloudHSM
↓ use key material in HSM
↓
crypto operations
  • Thanks to that, services such as: EBS · S3 · RDS
  • Can still use integration with KMS.
  • Key Material = is in CloudHSM; instead of being in the KMS-managed key store.
  • CloudTrail can still audit KMS key usage.

CloudHSM Placement

  • CloudHSM cluster is deployed in: VPC
VPC
│
├─ Application
│
└─ CloudHSM Cluster
    ├─ HSM AZ A
    └─ HSM AZ B
  • Application can connect to HSM via private network.
  • If the workload is located in another VPC, network connectivity can be used like:
  • VPC Peering; to allow the application to access the CloudHSM cluster.

CloudHSM Integrations

  • CloudHSM Do not replace KMS itself for AWS services.

For example, EBS natively integrates directly with:

EBS
↓
KMS

rather than:

EBS
↓
CloudHSM

If you want EBS to use the key in HSM:

EBS
↓
KMS
↓
Custom Key Store
↓
CloudHSM
  • Permissions still need to be correct: IAM · KMS Key Policy · Service Permission · CloudHSM configuration

CloudHSM can also be used for workloads that need to directly use HSM, for example:

  • Oracle TDE · Database encryption · Digital signing · TLS cryptographic workload

4. Practical example

An enterprise needs HSM-compatible cryptographic libraries and customer-managed HSM user permissions.

If you only need regular encryption:

AWS-managed encryption
↓
KMS

If compliance requires:

Dedicated HSM
↓
CloudHSM

If needed:

Customer self-management
Keys
Users
Permissions
↓
CloudHSM

If you want: AWS Service · still uses KMS API · but · Key Material · must be in dedicated HSM

then use: KMS Custom Key Store + CloudHSM

5. Comparison

CloudHSM requires managing HSM users, keys, and capacity; KMS provides managed key APIs.

CloudHSM vs KMS

KMSCloudHSM
Service typeManaged key serviceDedicated HSM
TenancyMulti-tenant managed serviceSingle-tenant / dedicated
Key managementAWS manages the infrastructureCustomer manages key/user
Key materialKMS protectsLocated in dedicated HSM
HAAWS is self-governedCustomer deploys multiple HSMs
APIKMS APICloudHSM Client / crypto libraries
AWS service integrationVery easyUsually through KMS Custom Key Store
OperationMore simpleMore complicated
Free tierYesNo

KMS = managed = simple = AWS takes care of many things

CloudHSM = dedicated hardware = more customer control = more operations for the customer

AWS WAF, Shield & Firewall Manager

1. Concept

WAF filters web requests, Shield mitigates DDoS, and Firewall Manager applies shared security policies across accounts.

2. Purpose

Protect Internet-facing workloads in 3 layers:

3. How it works

  • WAF = HTTP request filtering = Layer 7
  • Shield = DDoS protection
  • Firewall Manager = Centralized security policy management for multiple AWS accounts/resources

AWS WAF

  • AWS WAF protects applications in: Layer 7 = HTTP / HTTPS
  • WAF can be attached to: Application Load Balancer · API Gateway · CloudFront · AppSync · Cognito User Pool
  • Do not attach directly to: Network Load Balancer
  • because: NLB = Layer 4 = TCP / UDP
  • WAF = Layer 7 = HTTP

Web ACL

  • WAF uses: Web ACL = set of rules to decide Allow / Block request
HTTP Request
↓
WAF Web ACL
↓
Rules
↓
Allow / Block
  • Popular rules: IP Set = allow/block IP
  • According to the slides: IP Set · ≤ 10,000 IP addresses
  • String Match = check Header / Body / URI
  • Used to detect patterns such as: SQL Injection · XSS
  • Additionally: Size Constraint = check request size
  • Geo Match = filter by country
  • Rate-Based Rule = limit too many requests from one source

For example:

1 IP
↓ sending too many requests
Rate-Based Rule
↓
Block

Web ACL Scope

  • Web ACLs are typically: Regional
ALB
API Gateway
↓
Regional Web ACL
  • CloudFront specifically uses: CloudFront Scope

Rule Group

  • Rule Group = group multiple WAF rules = reusable
SQLi Rule
XSS Rule
Bad IP Rule
Rate Limit Rule
↓
Rule Group
↓
multiple Web ACLs
  • → helps reuse security rules.

AWS Shield

  • AWS Shield protects against: DDoS Attack
  • Especially in: Layer 3 / Layer 4
  • SYN Flood · UDP Flood · Reflection Attack

Shield Standard

  • Shield Standard = default enabled = free = baseline DDoS protection
  • AWS provides itself to customers.
  • Used to reduce common DDoS attacks at the network/transport layer.

Shield Advanced

  • Shield Advanced = Advanced DDoS protection
  • Protect resources such as: EC2 · ELB · CloudFront · Global Accelerator · Route 53
  • There are more: Advanced mitigation · 24/7 DDoS support · Cost protection
  • → suitable for workloads with high DDoS risk or requiring specialized support.
  • ≈ $3,000 / Organization / month

Pricing is subject to change. Check current AWS Pricing.

AWS Firewall Manager

  • Firewall Manager: Centrally manages security rules across AWS accounts in Organizations.
  • Scope: Select OUs or accounts; matching resources inside them receive the policy.
  • Example: Every public ALB in the Production OU must have the same WAF rules, including newly created ALBs.
  • Managed services: Can manage policies for WAF, Shield Advanced, security groups, Network Firewall, and Route 53 Resolver DNS Firewall.
  • Enforcement: Firewall Manager applies and checks policies; the underlying WAF, firewall, or security group filters traffic.
Security Account
↓
Firewall Manager Policy
↓
OU/Accounts
├─ Account A
├─ Account B
├─ Account C
└─ New account
OU Production
↓
every Public ALB
↓
must have a standard WAF policy
Account A → ALB → WAF
Account B → ALB → WAF
Account C → ALB → WAF
New account/resource
↓
is within scope policy
↓
Firewall Manager
↓
enforce baseline policy

Fixed IP + WAF

  • If needed: Fixed IP + WAF protection

can use:

User
↓
Global Accelerator
↓ fixed Anycast IP
ALB
↓
Regional WAF
↓
Application
  • Points to remember: Global Accelerator = provides fixed Anycast IP
  • WAF ≠ attach directly to Global Accelerator
  • WAF attached to: ALB; behind.

WAF and NLB

WAF does not protect NLB directly:

NLB
= Layer 4
↓
WAF does not attach
  • If Layer 7 filtering is needed: ALB / CloudFront / API Gateway + WAF

DDoS-Resilient Architecture

  • Can combine: Route 53 · CloudFront · Global Accelerator · ELB · Auto Scaling Multi-AZ · WAF · Shield
User
↓
CloudFront
↓
WAF
↓
ALB
↓
Auto Scaling
↓
EC2

CloudFront helps:

Cache content
↓
Reduce requests to the backend

WAF helps:

Managed Rules
Rate-Based Rules
↓
Filter malicious HTTP traffic
  • Shield helps: DDoS mitigation
  • SG/NACL continues to protect: Network Layer

API Gateway Protection

API Gateway has additional controls such as:

  • Burst / Throttling Limit · API Key · Header Filtering
  • → helps reduce attack surface.
  • API Gateway controls ≠ replace WAF ≠ replace authorization
  • They are additional layers of protection.

Overall flow

User
↓
CloudFront / Global Accelerator
↓
WAF Web ACL
↓
ALB / API Gateway
↓
Auto Scaling Workload

In which:

WAF
= filter HTTP requests

Shield
= reduces DDoS

Firewall Manager
= select account/OU as scope
↓
enforce security policy
Up the resources inside

Details of AWS WAF Rate-Based Rule

  • WAF Rate-Based Rule Counts the number of requests from each source IP (or composite key) in a sliding window 5 minutes and automatically Block Temporarily exceed the IP threshold right at CloudFront, ALB or API Gateway without writing a Lambda to process logs.

4. Practical example

A website uses WAF against abnormal requests; the company applies consistent policies across accounts with Firewall Manager.

Block SQLi / XSS / bad IP
↓
WAF
Rate limit web/API
↓
WAF
Baseline DDoS protection
↓
Shield Standard
Advanced DDoS protection
+ expert support
↓
Shield Advanced
Central security policy
for multiple AWS accounts/resources
↓
Firewall Manager

5. Comparison

WAF handles layer 7; Shield mitigates DDoS; Network Firewall controls network traffic in VPC architectures.

WAF vs Shield vs Firewall Manager

  • WAF = is the HTTP request valid?
  • Shield = are you experiencing DDoS?
  • Firewall Manager = Are the accounts/resources following the general security policy?

Quick select:

SQL Injection / XSS
Bad IP
Geo blocking
Rate limit
↓
WAF
SYN Flood
UDP Flood
DDoS
↓
Shield
Multiple AWS accounts
need the same security policy
↓
Firewall Manager
Amazon GuardDuty, Inspector & Macie

1. Concept

GuardDuty finds suspicious activity, Inspector finds vulnerabilities, and Macie discovers sensitive data in S3.

2. Purpose

Distinguish between 3 types of security finding:

3. How it works

Amazon GuardDuty, Inspector & Macie

  • GuardDuty = detect threats / unusual behavior
  • Inspector = find vulnerability + network exposure
  • Macie = find sensitive data / PII in S3

Amazon GuardDuty

  • GuardDuty is: Managed Threat Detection
  • Machine Learning · Anomaly Detection · Threat Intelligence; to detect suspicious behavior.
  • Main data source: CloudTrail · VPC Flow Logs · DNS Logs
  • Detection example: Unusual API calls · Suspicious network traffic · Malicious IP · Cryptocurrency mining · Suspicious DNS activity

There is additional protection for some services such as:

  • EKS · RDS / Aurora · EBS Malware · Lambda · S3
  • No need to install agents on the workload.
AWS Logs / Activity
↓
GuardDuty
↓
Finding
↓
EventBridge / Security Hub
↓
SNS / Lambda / Workflow
  • GuardDuty = detect threat ≠ self-remediation

Amazon Inspector

  • Inspector is used to find: Known Vulnerabilities + Network Reachability
  • Support: EC2 · ECR Container Images · Lambda
1. EC2
EC2
↓
Inspector
↓
scan OS / packages
↓
compare CVE database
  • Can detect: Outdated package · Known CVE · Unintended network exposure
2. ECR
Container Image
↓
Inspector
↓
CVE Finding
3. Lambda
Lambda Code / Dependencies
↓
Inspector
↓
Vulnerability Finding
  • Inspector creates: Finding + Risk Score; to prioritize remediation.
  • Inspector = find vulnerabilities ≠ patch / redeploy yourself

Amazon Macie

  • Macie specializes in finding: Sensitive Data · PII
  • in: Amazon S3
  • Machine Learning · Pattern Matching

For example:

S3 Bucket
↓
Macie Scan
↓
PII / Sensitive Data Finding
  • Can detect data such as: Name · Email · Phone · ID / sensitive information
  • Macie: = discover sensitive data ≠ self-correct Bucket Policy / IAM / encryption
  • After finding, the team can: Block Public Access · Fix Bucket Policy · Enable Encryption · Delete unnecessary data

Amazon Security Lake

  • Amazon Security Lake automatically collect, standardize, and centralize security data Amazon S3 in your account to analyze, investigate incidents, and collate data from multiple sources.
Security logs / events
AWS + on-premises + third-party sources
↓
Amazon Security Lake
↓ OCSF + Apache Parquet standardization
Amazon S3
↓
Athena / analytics tools / SIEM
  • Security Lake automatically normalizes integrated AWS sources; custom sources must send data as requested by OCSF/Parquet.
  • This is a secure data centralized platform; GuardDuty, Inspector, and Macie provide corresponding detection types. ·

GuardDuty RDS Protection & Two Amazon Inspector Testing Groups

Features / Scan modesObject & Detection Mechanism
GuardDuty RDS ProtectionAnalyze login and data access behavior on Aurora/RDS to detect potential threats without degrading DB performance
Inspector — Known Vulnerabilities (CVE)Continuous automatic scanning for OS/packages vulnerabilities on EC2, container images in ECR and dependencies/code of AWS Lambda
Inspector — Network ReachabilityDetect network lines and ports that are too open to EC2 from outside the VPC without needing to install a separate agent for network testing

4. Practical example

Security uses Inspector to find image CVEs and Macie to examine buckets containing personal data.

  • EventBridge route GuardDuty cryptocurrency finding to SNS on-call and Lambda isolates instances according to runbook.
  • Inspector detected CVE in ECR image before/concurrent deployment; team patch image and redeploy immutable container.
  • Macie scans the S3 data lake for mistakenly saved PII, then applies S3 Block Public Access, least-privilege policy, and SSE-KMS.
  • Security Lake pools CloudTrail, VPC Flow Logs, and other security sources into S3 for incident investigation using Athena or SIEM.

5. Comparison

Threat detection, vulnerability scanning, and sensitive-data discovery answer different security questions.

GuardDuty vs Inspector vs Macie

  • GuardDuty: Finds suspicious activity or signs of compromise, such as unusual API calls or connections to malicious IPs.
  • Inspector: Finds vulnerabilities in supported resources, such as software versions that can be exploited.
  • Macie: Finds sensitive data in S3, such as personal information stored in files.
  • Memory aid: GuardDuty finds suspicious behavior; Inspector finds weaknesses; Macie finds sensitive data.
Suspicious API / traffic / crypto mining
↓
GuardDuty
CVE / vulnerable package / network exposure
↓
Inspector
PII / sensitive data in S3
↓
Macie
AWS Security Hub, Amazon Detective & AWS Audit Manager

1. Concept

Security Hub aggregates security findings, Detective supports investigations, and Audit Manager collects evidence for audits.

2. Purpose

Centralize security alerts, investigate the root cause of incidents, and automatically collect compliance audit evidence.

3. How it works

Actual coordination flow

GuardDuty/Inspector/Macie detect anomalies
  ├─► AWS Security Hub → Aggregate, score compliance & trigger response via EventBridge
  ├─► Amazon Detective → Tracing behavioral graphs to find the root cause (Root Cause)
  └─► AWS Audit Manager → Consolidate API history/configuration/findings into an audit evidence report

4. Practical example

A GuardDuty finding appears in Security Hub; investigators use Detective and retain evidence for an audit.

5. Comparison

Finding aggregation, root-cause investigation, and evidence collection are different activities rather than interchangeable services.

Table distinguishing three services

ServiceQuestion resolvedMain mechanism
AWS Security HubWhat risks and violations of standards are there in the overall environment that need to be prioritized for handling?Collect standardized findings (ASFF) from GuardDuty, Inspector, Macie, Firewall Manager, Config and score automatically according to the standard set CIS, PCI-DSS, AWS FSBP
Amazon DetectiveWhere did the newly discovered security incident come from and what is the scope of its impact?Build automatic link graphs from CloudTrail, VPC Flow Logs, EKS audit logs and GuardDuty findings to Root Cause Analysis
AWS Audit ManagerHow to export compliance evidence to auditors without having to collect it manually?Continuously Evidence gathering (Evidence) from CloudTrail, Config, Security Hub and map to controls of PCI-DSS, HIPAA, GDPR, SOC 2 into Assessment Report

Networking & Hybrid VPC

Amazon VPC foundations: CIDR, subnets & routing

1. Concept

A VPC is a private virtual network in a Region; a subnet is a network segment in one AZ where resources are placed.

2. Purpose

Create a private network in an AWS Region, select IP range, divide subnet by AZ and control traffic path.

3. How it works

VPC, subnet and CIDR

ComponentIP Range & Banding Rules
VPCLevel range Region; A VPC can contain many subnets spanning many Availability Zones
SubnetFixed mounting with an AZ; Subnets in the same VPC must not overlap IP ranges
CIDRIP range with prefix length — the larger the prefix, the smaller the range (/24 = 256 IP, /26 = 64, /27 = 32, /32 = 1 IPv4)
  • Commonly used private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Avoid overlap with VPC/on-premises that need connection.
VPC 10.0.0.0/16
├─ AZ A: public 10.0.0.0/24 · private 10.0.1.0/24
└─ AZ B: public 10.0.2.0/24 · private 10.0.3.0/24

IP can be used in subnet

AWS keeps the first 4 IPv4s and 1 last IPv4. Subnet example 10.0.0.0/24:

IPMeaning
10.0.0.0Network Address — represents the entire subnet
10.0.0.1VPC Router — route traffic
10.0.0.2Amazon-provided DNS — resolve domain → IP
10.0.0.3Reserved — AWS holds for future use
10.0.0.255Broadcast Address — AWS still reserves even though VPC does not support broadcast
  • Usable IPv4 = total IP − 5. /27 27 IPs left; If you need 29 IPs, choose /26 with 59 usable IPs.
  • IPv4 subnets typically have a prefix from /16 come /28. VPC does not support IP broadcast. .

Route Table and longest prefix match

  • Destination = destination to be reached; target = where to go. Route 10.0.0.0/16 → local for internal VPC traffic.
  • The most specific route wins. Destination 10.20.1.10 choose 10.20.0.0/16 instead 10.0.0.0/8.
  • Each subnet uses a route table; Multiple subnets can share the same table.
  • Target can be IGW, NAT, peering, endpoint, VGW or TGW.
  • 0.0.0.0/0 = all IPv4; ::/0 = all IPv6. Dual-stack uses both types of addresses and corresponding routes.

Public and private subnets

Network componentsInternet routing mechanism
Public SubnetRoute Table has a direct route out IGW; If EC2 wants to go to the Internet using IPv4, it needs Public IPv4/EIP and SG/NACL permission
Private SubnetThere is no direct route out IGW; IPv4 resources that want to go out onto the Internet usually go through one-way traffic NAT Gateway
Internet Gateway (IGW)Internet gateway managed by AWS (HA & scalable available); Just attaching IGW to VPC is not enough if the Route Table has not been updated
Public EC2 has public IPv4 → IGW → Internet
Private EC2 → NAT Gateway in public subnet → IGW → Internet

Design and cost

Design modelArchitectural significance
Default VPC vs Custom VPCDefault VPC pre-builds public subnets, IGW and routes for quick testing; Custom VPC allows self-design of CIDR and strict public/private layer separation
Multi-AZPlace application tiers across multiple AZs to tolerate infrastructure failures; Prioritize using Private IP for internal communication
  • Cross-AZ, Cross-Region, NAT processing and Internet egress may incur fees; Optimize the path while still maintaining fault tolerance.

4. Practical example

An application places its ALB in public subnets and its database in private subnets with suitable routes and access controls.

Three-tier web: public ALB, application and private database, deployed on at least two AZs.

Set up CIDR before connecting AWS to on-premises to avoid overlap; Choose a subnet with enough IP for EC2, ENI and increased load.

5. Comparison

Route tables select paths; security groups and NACLs permit traffic; each subnet belongs to one AZ.

VPC Internet access: IGW, bastion, NAT & IPv6

1. Concept

An Internet Gateway connects a VPC to the Internet; NAT lets private resources initiate outbound access without accepting new inbound Internet connections.

2. Purpose

Send workloads to the Internet in the right direction: public resources via IGW; private resource actively goes out but does not receive new connections from the Internet via NAT/egress-only IGW.

3. How it works

Public IPv4 qua Internet Gateway

  • Three conditions: route 0.0.0.0/0 → IGW, public IPv4/EIP, SG/NACL allow correct traffic.
  • IGW attached to VPC; The subnet's route table determines whether the workload has an IGW outlet or not.
Internet client
↓ HTTPS 443
IGW → public ALB/EC2
↓ private IP
Application private → database private

Private IPv4 qua NAT Gateway

Private EC2
↓ private route: 0.0.0.0/0 → NAT
Public NAT Gateway has EIP
↓ public route: 0.0.0.0/0 → IGW
IGW → Internet
↑ response of opened EC2 connection
  • NAT Gateway: Lets EC2 in a private subnet initiate Internet access, such as downloading updates. Internet hosts cannot initiate new connections to EC2 through it.
  • Public NAT: Lives in a public subnet with an Elastic IP and a route to an Internet Gateway.
  • Zonal NAT: AWS manages and scales it within one AZ; NAT Gateways do not have security groups.
  • Multiple AZs: Each private subnet should use a zonal NAT in the same AZ to avoid depending on another AZ and reduce cross-AZ charges.
  • Cost: Charged by time and data processed. S3/DynamoDB traffic can use gateway endpoints to avoid NAT.
  • Comparison: NAT provides outbound access; it does not provide server login like a bastion or Session Manager.

NAT Gateway and NAT Instance

CharacteristicsNAT GatewayNAT Instance
TypeAWS-managed serviceEC2 instance
Manage OS/PatchAWSYou
ScalingAWS managedSelf-scale
BandwidthAuto scale according to sourceAccording to EC2 type
High AvailabilityAZ-level; Multi-AZ typically implements NAT per AZDesign yourself
Public SubnetYesYes
Elastic IPYesYes
Security GroupNoYes
Bastion HostNoMaybe
Source/Destination CheckNo management requiredMust disable
RecommendedModern/default choiceLegacy / custom control
  • NAT Instance = EC2 does NAT itself. Source/destination check must be turned off because it forwards traffic from another machine; self-managed patching, scaling and failover.

Bastion and administrative access

Admin IP / office CIDR
↓ SSH 22
Bastion EC2 is in public subnet
↓ SSH 22
Private EC2
Security GroupMinimum port opening rule
Bastion SGAccept only TCP 22 from specific admin/office IP range, avoid opening SSH for 0.0.0.0/0
Private EC2 SGAccept only TCP 22 whose reference source is Bastion SG (more flexible and secure than hard-code IP)

IPv6: IGW, egress-only IGW and NAT64

IPv6 mechanismConnection direction & How it works
Internet Gateway (IGW)Route ::/0 → IGW; Enables two-way IPv6 communication if SG/NACL allows it
Egress-only IGWRoute ::/0 → egress-only IGW; instance proactively goes out to the IPv6 Internet and receives responses, blocking the Internet direction from opening new incoming connections
DNS64 + NAT64When IPv6 subnet needs to call a destination that only supports IPv4: DNS64 synthesizes IPv6 addresses and NAT Gateway uses NAT64 to translate to IPv4 (AWS Docs)
IPv4 private → NAT Gateway → IGW → Internet IPv4
IPv6 outbound → egress-only IGW → Internet IPv6
IPv6 client + DNS64 → NAT64 on NAT Gateway → IPv4 service

Regional NAT Gateway

  • Regional mode: one NAT ID for multiple AZs, self-scaling according to workload in automatic mode; No need for public subnet to set NAT.
  • There is a separate route table with routes to IGW; Does not support private NAT. Distinguished from zonal NAT when the problem clearly specifies the mode. .

4. Practical example

A private EC2 instance downloads patches through a NAT Gateway without accepting direct inbound Internet connections.

SituationStandard network solution
Three-tier websiteInternet → Public ALB (443) → Private App (8080, received from ALB SG) → Private RDS (5432, received from App SG); NAT is only needed if the App calls to the Internet
Private EC2 downloads patches/calls external APIsGo through Public NAT Gateway; The Internet only responds to opened connections, reverse SSH over NAT is not possible
Private EC2 reads S3/DynamoDBUse Gateway VPC Endpoint Combine IAM/Resource Policy for free internal travel, reducing processing fees via NAT
Private IPv6 goes out to the InternetUse Egress-only Internet Gateway to block all connections initiated from outside the Internet

5. Comparison

  • An IGW supports Internet connectivity for eligible resources;
  • NAT provides private IPv4 outbound access;
  • egress-only IGWs serve IPv6 outbound access.

Distinguish between Public NAT vs Private NAT & Zonal NAT vs Regional NAT

NAT Gateway typeElastic IP & IGWIntended use
Public NAT GatewayRequired to attach Elastic IP, located in Public Subnet with route out to IGWLet resources in Private Subnet go out to the IPv4 Internet one-way
Private NAT GatewayDo not attach Elastic IP, does not go through IGWTranslate source IP for pure internal connection to another VPC or On-premises network (e.g. avoid IP range conflicts)
Zonal NAT vs Regional NATZonal attaches 1 AZ (standard HA requires 1 NAT/AZ); Regional is managed at the Region levelRegional NAT automatically expands to serve multiple AZs in the Region without having to manually manage each NAT for each AZ
VPC traffic controls, visibility & AWS Network Firewall

1. Concept

Security groups, NACLs, and firewalls filter traffic; visibility tools help inspect and troubleshoot connections.

2. Purpose

Block/allow traffic at the correct layer, observe when connection errors occur, and inspect traffic more deeply using AWS Network Firewall.

3. How it works

Security Group and NACL

CharacteristicsSecurity GroupNACL
LevelENI / ResourceSubnet
AllowYesYes
DenyNoYes
StatefulYesNo
Return trafficAuto allowThere must be rules
Rule priorityConsider the appropriate rulesAccording to rule number
ApplyResource is attachedAll resources in the subnet
  • SG = ENI/resource firewall. Only allow; stateful so the connection's response has been allowed to reverse itself.
  • NACL = subnet firewall. Allow + deny; stateless, so request and response must both have appropriate rules.
  • SG and NACL apply together: if one layer blocks, traffic is still blocked, even if the other layer allows it.

NACL: order and default

  • A small number of rules is considered first; first match wins. Rule no 1–32766; bottom of the table is * → deny.
  • For example 100 allow 10.0.0.0/8 stand before 200 deny 10.1.1.10/32: That IP is allowed because it matches rule 100.
  • Default NACL: allow inbound/outbound. New Custom NACL: deny all traffic until the allow rule is added.
  • Leave space between rule numbers like 100, 200, 300 to easily insert higher priority rules.

Ephemeral ports and return traffic

Request:  Web 10.0.1.10:50000 → DB 10.0.2.20:3306
Response: DB 10.0.2.20:3306   → Web 10.0.1.10:50000
  • 3306 = MySQL port; 50000 = temporary client port. NACL must allow routes to the service port and routes to the ephemeral port.
  • Range depends on OS: for example Windows/IANA 49152–65535, some Linux 32768–60999; Do not assume all clients use the same range.
  • Stateful SGs do not need a separate rule just to ensure the connection's response is allowed.

VPC Flow Logs: observe metadata

  • Turn on VPC, subnet or ENI; Record source/destination IP, port, protocol, packets/bytes, time and ACCEPT/REJECT.
  • Other useful fields: account-id, interface-id, start/end, log-status.
  • Does not contain payload and does not block traffic. dstport=22, action=REJECT helps localize SSH rejected by SG/NACL; still need to check route, DNS, OS and application.
  • Send to CloudWatch Logs, S3, or Data Firehose.
Flow Logs → CloudWatch Logs → Metric Filter / Contributor Insights → Alarm → SNS
Flow Logs → S3 → Athena → historical analytics / QuickSight

Traffic Mirroring: copy packet

ENI ├─ origin traffic → destination
    └─ copy → IDS / packet analyzer / security appliance
  • Mirroring for realistic packet analysis. Tool observes copies; Original traffic is still running. If you want to inspect and block along the way, use a firewall.

AWS Network Firewall

  • Managed firewall in VPC: Supports stateless and stateful inspection; Can match IP, port, protocol, domain/pattern with allow/drop/alert action according to rule type.
  • Must route traffic through the firewall endpoint. Used for Internet, VPC-to-VPC or hybrid traffic depending on architecture; Design both the outbound and return routes for stateful inspection to operate.
  • Firewall logs can be sent to S3, CloudWatch Logs or Data Firehose for audit/investigation.
Private workload
↓ route to firewall endpoint
Network Firewall: inspect → drop bad traffic
↓ allow valid traffic
NAT Gateway → IGW → Internet
ServiceLevelStatefulAllow/DenyPurpose
Security GroupENI / ResourceYesAllowLeast privilege for resources
NACLSubnetNoAllow + DenyBoundary filtering
Network FirewallVPC traffic pathYesAllow / Drop / AlertAdvanced inspection

CloudWatch Network Monitor, Network Access Analyzer & Firewall Routing

Network toolsFunctions & Distinguishing Points
Network Firewall RoutingOther than SG (attached to ENI) and NACL (attached to Subnet) are self-filtered, AWS Network Firewall requires adjusting the Route Table to direct traffic through the Firewall Endpoint
CloudWatch Network Synthetic MonitorProactively monitor latency and packet loss between networks Subnets in AWS VPC and On-premises networks
VPC Network Access Analyzer vs Reachability AnalyzerNetwork Access Analyzer Extensive auditing to find any unwanted network access (compliance); Reachability Analyzer diagnose the specific path between source A and destination B

4. Practical example

A database connection times out; operations checks routes, security groups, NACLs, and Flow Logs to locate the block.

SituationHow to configure/Test
Least privilege for 3-tier WebALB SG opens 443 from Internet → App SG only receives application port from ALB SG → DB SG only receives 3306 from App SG
Block bad IP ranges at Subnet levelSet rules Deny 1.2.3.0/24 There is a small number before the larger Allow rules NACL
Diagnosing the error of not being able to SSHCheck Route Table, SG/NACL and VPC Flow Logs (ACCEPT/REJECT — log only observes, does not automatically block traffic)
Deeply examine Outbound trafficEdit the Route Table to go through AWS Network Firewall before going to the Internet (use Traffic Mirroring if you only need to send a copy to the IDS)

5. Comparison

Security groups are stateful and NACLs stateless; Flow Logs record metadata; Traffic Mirroring copies packets for analysis.

VPC private connectivity: peering & endpoints

1. Concept

VPC peering connects two VPCs; VPC endpoints and PrivateLink provide private service access instead of using the public Internet.

2. Purpose

Private connection between VPCs or to a service without the need for public Internet, IGW or NAT.

3. How it works

VPC Peering: connecting two networks

  • VPC peering: Directly connects two VPCs so resources communicate over private addresses; accounts and Regions may differ.
  • Requirement: The VPC address ranges (CIDRs) must not overlap.
  • Configuration: Create and accept the connection, add routes in both directions, and allow traffic in security groups and NACLs.
  • No transit through another VPC: A–B and B–C connections do not connect A to C. Add A–C peering or use Transit Gateway.
VPC A: 10.0.0.0/16
  route 10.1.0.0/16 → pcx-123
↓ peering connection
VPC B: 10.1.0.0/16
  route 10.0.0.0/16 → pcx-123

Gateway Endpoint and Interface Endpoint

CharacteristicsGateway EndpointInterface Endpoint
ServiceS3, DynamoDBMost AWS services
MechanismRoute TableENI + Private IP
ENINoYes
Private IPNoYes
Security GroupNoYes
PrivateLinkNoYes
Cost according to sourceFreeHourly + GB processed
ComponentResolution Mechanism & Connection
Gateway EndpointAdd prefix list of S3/DynamoDB to Route Table; Does not create ENI, does not attach Security Group and is free
Interface EndpointCreate an ENI with Private IP in the subnet connecting via PrivateLink; The Endpoint's Security Group needs to be opened HTTPS 443 from the client side
Private DNSAllows to keep the default hostname of the AWS service but resolve it directly to the Private IP of the Interface Endpoint (need to enable DNS support/hostnames on VPC)
Private EC2 → route table → Gateway Endpoint → S3 / DynamoDB
Private EC2 → Interface Endpoint ENI → PrivateLink → Secrets Manager

PrivateLink and Endpoint Service

  • PrivateLink = access specific service. Consumers cannot connect to the entire provider's network like peering.
  • Provider: application behind NLB, create Endpoint Service and enable appropriate consumers.
  • Consumer: create Interface Endpoint in VPC; Connect via PrivateLink to the exposed service.
Consumer application
↓ Interface Endpoint ENI
PrivateLink
↓ Endpoint Service
Provider NLB → provider application
VPC PeeringAWS PrivateLink
TargetConnect 2 VPCsAccess/expose service
TypeNetwork-to-networkConsumer-to-service
Target routepcx-...Do not use pcx
Full network accessMaybeNo
CIDR overlapNo wayNo need for full inter-VPC routing
TransitiveNoNot transit network
Consumers seeOther VPC/networkSpecific service

Network lines do not change permissions

  • Endpoint only creates private path. IAM, resource/bucket policy, endpoint policy and KMS permission are still considered.
  • For example, EC2 to S3 via Gateway Endpoint is successful on the network but missing s3:GetObject Still Access Denied.

Check when connection error

Connection modelTest string when encountering an error
VPC PeeringNo duplicate CIDR → Status Active → Route Table both directions → NACL → Security Group
Gateway EndpointRoute Table has attached Endpoint → Endpoint Policy → IAM Policy / Bucket Policy
Interface EndpointPrivate DNS / Private IP → Security Group of Endpoint ENI → Endpoint Policy → IAM

VPC Peering Fee, Overlapping CIDR, VPC Lattice & 4 VPC Connection Terms

Note VPC Peering & Gateway EndpointArchitectural rules
VPC Peering costsFree connection creation/maintenance and free data transfer with AZ; Charges for data transmission when different from AZ or Other Region
Inter-Region Peering & Security GroupCannot reference the ID of a Security Group belonging to a VPC in another Region → the rule must be opened in ranges Private IP/CIDR
S3 / DynamoDB Gateway EndpointOnly serves resources located in the VPC attached to that Route Table; no bridging across Peering/TGW
  • Amazon VPC Lattice: Application layer connection and authorization services (HTTP/HTTPS/gRPC/TCP) between services across multiple VPCs/Accounts with IAM integration without the need to build Peering or TGW.
Connection solution between 2 VPCsSupport Overlapping CIDR (overlapping IP range)?
VPC Peering / Transit Gateway pure routingNo
AWS PrivateLink (Interface Endpoint + Endpoint Service + NLB)Yes
Amazon VPC LatticeYes
Transit Gateway combines 1:1 NAT / Private NAT GatewayYes
4 Easy-to-confuse terms in the topicOwnership serviceUses
VPC ConfigurationLambda / CodeBuild / SageMakerAttach Hyperplane ENI to call private resources in VPC
Glue ConnectionAWS GlueConfigure the VPC network so that the ETL job reads/writes private RDS/Redshift
VPC LinkAmazon API GatewayPass requests from API Gateway to private ALB/NLB in VPC
VPC ConnectorAWS App RunnerTell the App Runner service to send traffic to private resources in the VPC

4. Practical example

EC2 reads S3 through a gateway endpoint instead of sending S3 traffic through a NAT Gateway.

  • Two VPCs need to access many of each other's resources: peering; Many VPCs need hub routing: TGW.
  • Private subnet reads S3/DynamoDB: Gateway Endpoint; Call Secrets Manager or PrivateLink support service: Interface Endpoint.
  • Provide internal API for another account and only expose that API: Endpoint Service + PrivateLink.

5. Comparison

Peering connects network pairs without transit; PrivateLink exposes services without connecting entire networks.

Hybrid & transit networking: VPN, Direct Connect & Transit Gateway

1. Concept

VPN and Direct Connect link corporate networks to AWS; Transit Gateway is a central hub connecting multiple networks.

2. Purpose

Connect on-premises to AWS and consolidate multiple VPCs/accounts into one network with controlled routing.

3. How it works

Direct Connect, Site-to-Site VPN and Transit Gateway

CriteriaDirect Connect (DX)Site-to-Site VPNTransit Gateway (TGW)
PurposeOn-premises private connection ↔ AWSSecure on-premises VPN tunnel ↔ AWSCentral router connects multiple VPCs and on-premises
Transmission linePrivate network via carrier/DX PartnerUsually via the Internet; There is also VPN over DXAWS network, depending on attachment
Current bandwidth50 Mbps–400 Gbps depending on hosted/dedicated connectionStandard: up to 1.25 Gbps/tunnel; Large: up to 5 Gbps/tunnelVPC attachment: up to 100 Gbps each direction/AZ
EncryptionNo defaultIPsecDon't add end-to-end encryption yourself; Use mechanisms appropriate to attachment
BGPYesSometimes Dynamic Routing; Static Routing can be usedLearn routes via appropriate VPN/DX attachments
Use caseLong lasting hybrid, high bandwidth and stabilityFast deployment; backup path for DXMultiple VPCs, centralized/transitive routing
Point to rememberDo not go over the public InternetThroughput depends on network, device and trafficDo not create your own Internet connection or VPN/DX acceleration
  • VPN = Internet + IPsec. Quick deployment, data protection with encrypted tunnel; Stability depends on Internet connection.
  • DX = dedicated connection line. Long-term hybrid and big data fit; private is not synonymous with encrypted.

Site-to-Site VPN: components

On-premises network
↓ customer router/firewall (Customer Gateway)
Internet + IPsec tunnels
↓ VGW attached to VPC or TGW
Route table → private workload
Site-to-Site VPN componentRoles & Configuration Notes
Customer Gateway (CGW)Resource on AWS represents the client-side router/firewall; Needs a routable public IP (or IP of the NAT device when using NAT-T)
Virtual Private Gateway (VGW)AWS-side VPN connector attached a VPC (switch to TGW if you need to consolidate many VPCs)
Hai IPsec TunnelsEach Site-to-Site VPN connection creates 2 tunnels at 2 different ends — both need to be configured to ensure High Availability
Route PropagationAutomatically inject route learned via BGP from VGW into VPC Route Table (still need to configure return route on-prem and open SG/NACL, for example ICMP when ping)
AWS VPN CloudHubAllows multiple branches to connect BGP to the same VGW for site-to-site communication via hub-and-spoke model on VPN
AWS Client VPN — remote workers
  • AWS Client VPN is a managed VPN service for employees from laptops/PCs to securely connect to AWS VPC via the Internet TLS encryption, using OpenVPN-compatible client.
Employee laptop/PC
↓ OpenVPN client + Internet + TLS
AWS Client VPN endpoint
↓ routes + authorization rules + security groups
Private resources in VPC
  • Need to configure authentication (certificate, Active Directory or SAML), connection to target network and appropriate permissions/route; Successful VPN login does not automatically have access to all resources.
  • Client VPN: per device/user → AWS. Site-to-Site VPN: both office network/data center → AWS using IPsec.

Direct Connect, VIF and DX Gateway

Direct Connect conceptCharacteristics & Connection Rules
DX LocationPhysical transit point where your or your partner's network connects to the AWS backbone (both IPv4 and IPv6 supported)
Dedicated vs Hosted ConnectionDedicated: 1/10/100/400 Gbps separate physical cable port Hosted: provisioned via AWS DX Partner from 50 Mbps to 25 Gbps (AWS Docs)
3 types of VIF (Virtual Interface)Private VIF → enter VPC via VGW/DXGW · Public VIF → call AWS public endpoints (S3, SQS…) · Transit VIF → Connect to TGW via DXGW
Direct Connect Gateway (DXGW)Global object connects Private VIF to multiple VGWs or connects Transit VIF to multiple TGWs in multiple Accounts/Regions
Encryption on DXDirect Connect goes its own way but No default encryption; combine Site-to-Site VPN over DX (or MACsec on a supported port) when encryption is required
  • ON-PREMISES Data Center | v DIRECT CONNECT | +----------------+----------------+ | | | v v v TRANSIT VIF PRIVATE VIF PUBLIC VIF | | | v v | DX Gateway A DX Gateway B | | | | v v | Transit GW VGW | | | | +----+----+ v v | | VPC AWS Public VPC A VPC B | Endpoints | | EC2 S3 / APIs Account A Account B
  • Transit VIF → DX Gateway → TGW to reach multiple VPCs/accounts via VPC attachments. Private VIF → DX Gateway → VGW → VPC use private IP; Private VIF can also connect directly to VGW without needing a DX Gateway.
  • The two branches in the picture are used DX Gateways vary: Do not attach TGW and VGW to the same DX Gateway. Public VIF to AWS public endpoints via DX, not through DX Gateway/VGW; Service access is still required. ·

Transit Gateway: hub-and-spoke

Transit Gateway conceptRouting role
Transit Gateway (TGW)Region-level hub router connects multiple VPCs, Site-to-Site VPN and DXGW; support transitive routing
AttachmentBind a VPC, VPN or DXGW to the TGW (both VPC Route Table and TGW Route Table must still be updated)
Association vs PropagationAssociation decide which attachment to look up TGW Route Table; Propagation advertise the attachment's network range to the specified table (use the Prod ↔ Dev split while also opening to Shared Services)
Cross-Account & Cross-RegionShare TGW between accounts via AWS RAM; connecting across Region by TGW Peering
VPC PeeringTransit Gateway
TypeVPC ↔ VPCHub-and-Spoke
Transitive❌✅
Few VPCsSuitableCan overkill
Multiple VPCsComplex meshSuitable
VPN / DX integrationLimitationsGood
Cross-accountYesYes + RAM

Redundancy and increased bandwidth

  • DX HA: multiple connections/locations/routers; does not depend on a physical path. VPN can do backup with proper routing/failover.
ConceptFunctions/limitations
BGPRouters exchange route information themselves; BGP itself does not increase bandwidth
Static RoutingDeclare routes manually; Site-to-Site VPN using static routing does not support ECMP VPN
ECMPDivide multiple network flows through paths with the same priority; increases total throughput, does not speed up a TCP flow
Standard VPN tunnelUp to 1.25 Gbps/tunnel; Supports VGW and TGW
Large Bandwidth TunnelUp to 5 Gbps/tunnel; TGW/Cloud WAN only, VGW not supported; It depends on the Region
Service/configurationECMPConditions
Site-to-Site VPN + VGWECMP VPN is not supportedConfigure both tunnels for redundancy; a tunnel is preferred
Site-to-Site VPN + TGWYesEnable ECMP VPN, use BGP/dynamic routing and qualified routes
Direct ConnectAvailable in support configurationBGP multipath over multiple DX connections with appropriate routes/path attributes
Transit GatewayYes for appropriate VPN attachmentsIt does not mean that ECMP can be used for all types of attachments
  • The limits are tested day by day 13/10/2026, the throughput is not always achieved. Do not use the 100 Gbps level of VPC attachment to infer that the VPN tunnel also reaches 100 Gbps. · ·

Choose services according to your needs

ServiceWhat to use?
Client VPNEmployee Laptop/PC → AWS over Internet + TLS
Site-to-Site VPNOn-Prem ↔ AWS qua Internet
Direct ConnectDedicated private connection On-Prem ↔ AWS
Transit GatewayHub connects multiple VPC/VPN/DX
  • VPN/DX = on-premises connection; TGW is hub routing.
  • TGW does not replace VPN or DX lines.

Direct Connect Gateway (DXGW), SiteLink & BGP/ECMP Conditions

1 single VPC: On-Premises → DX → Private VIF → VGW → VPC
Multiple VPC/Reg: On-Premises → DX → Private VIF → DXGW → multiple VGW (multiple Accounts / Regions)
Via TGW Hub: On-Premises → DX → Transit VIF → DXGW → TGW → multiple VPCs
Site-to-Site: On-Premises A ↔ DX Location A ══(Direct Connect SiteLink)══ DX Location B ↔ On-Premises B
Mechanism/Note HybridRouting Rules & Differentiation Points
Trap DXGWVPCs are attached to the same DXGW do not communicate directly with each other (want VPC ↔ VPC must go through TGW or VPC Peering)
Direct Connect SiteLinkDirectly connect On-premises offices/data centers together via AWS's global backbone network without having to go around to a VPC in the Region
BGP, Route Propagation & ECMPBGP dynamic prefix exchange; TGW Association select routing table for attachment, also TGW Propagation Fill in the route in the TGW table (still have to declare the route in the VPC Subnet Route Table). ECMP Divide multiple TCP flows across equal paths to add total bandwidth (a single TCP flow does not accumulate): only works on VPN + TGW with Dynamic BGP enabled + VPN ECMP Support (VPNs attached to VGW or Static VPN do not support ECMP)
AWS Private 5GFormerly AWS private mobile network service (discontinued on May 20, 2025)

4. Practical example

A company uses Direct Connect with a backup VPN and routes to several VPCs through a transit gateway.

Actual needsArchitecture of choice
Need to connect Hybrid urgentlyBuild now Site-to-Site VPN via the Internet; Add Direct Connect later if stable dedicated bandwidth is needed
Large, long-term data transmissionUse Direct Connect build main road + Site-to-Site VPN backup; add VPN over DX if IPsec is required
Connect dozens of VPC / AccountsUse Transit Gateway make a shared hub AWS RAM and separate TGW Route Tables by Prod / Dev / Shared / Inspection

5. Comparison

  • VPN uses IPsec over the Internet;
  • Direct Connect is private connectivity without automatic encryption;
  • TGW centralizes transit routing.

Disaster Recovery & Migrations

Disaster Recovery: RPO, RTO & recovery strategies

1. Concept

Disaster recovery restores applications and data after a major incident.

2. Purpose

Prepare how to restore data + applications when a major incident occurs.

3. How it works

  • DR is usually balanced: RPO + RTO + Cost

4 Disaster Recovery strategies

Backup & Restore
↓
Pilot Light
↓
Warm Standby
↓
Multi Site / Hot Site
  • RTO gradually decreases
    Cost gradually increases
StrategyBefore disasterKhi disasterCost / RTO
Backup & RestoreOnly backupsRestore + rebuild the systemCheapest/slowest
Pilot LightCritical core/DB is availableLaunch app is missingFaster
Warm StandbyFull system running small sizeScale up + failoverNhanh
Hot SiteProduction is available on many sitesTransfer trafficMost expensive/fastest

Strategy

Typical RPO

Typical RTO

Cost

Backup & Restore

Hourly

Hourly, maybe up to 24 hours

$

Pilot Light

A few minutes to tens of minutes

Dozens of minutes

$$

Warm Standby

A few seconds to a few minutes

A few minutes

$$$

Active-Active

Close to 0

Close to 0

$$$$


Backup & Restore

  • Backup & Restore = keep backup/snapshot only.

Khi disaster:

Backup
↓
Restore DB
↓
Launch EC2 / Infrastructure
↓
Switch traffic

Common AWS services:

  • EBS Snapshot
  • RDS Backup / Snapshot
  • S3 / Glacier
  • AMI
  • CloudFormation

RPO depends on backup frequency. RTO is usually the highest.

Pilot Light

  • Pilot Light = keep only the most important part running.
  • DB / critical data = replicated
  • Application compute = not fully running yet
DB already exists
↓
Launch EC2/App
↓
Switch traffic

Pilot Light = core running, app not fully running yet.

Warm Standby

  • Warm standby: Keeps a complete working copy of the application at the recovery site, using fewer resources than production.
  • During recovery: Scale the recovery site's resources and route users there.
  • Example: The main Region runs 10 instances; the recovery Region runs 2 with all application components, then scales up to take production traffic.
  • Memory aid: The recovery system already runs; it needs to grow before taking all users.
ALB
↓
EC2 ASG small
↓
Secondary DB
Promote DB
↓
Scale ASG
↓
Switch traffic

Warm Standby = full system running, but small.

Multi Site / Hot Site

  • Multi Site / Hot Site = many sites/Regions running production capacity available.
Users
↓
Route 53
├─ Region A
└─ Region B

If Region A fails:

Route 53
↓
Region B
  • RTO: very low
  • highest cost

Database may still need:

Secondary
↓
Promote / Failover
↓
become writer

App active in 2 Regions does not mean that 2 DBs are both writers.

AWS Services are common in DR

  • Backup
  • EBS Snapshot
    RDS Backup
    S3 / Glacier
  • Replication
  • RDS Cross-Region
    Aurora Global Database
    S3 Cross-Region Replication
  • Traffic Failover
  • Route 53
  • Rebuild Infrastructure
  • CloudFormation
    AMI
  • Automation
  • CloudWatch
    Lambda

All-AWS Multi-Region Example

Region A:

ALB
↓
EC2 ASG
↓
Aurora Primary

Region B:

ALB
↓
EC2 ASG
↓
Aurora Secondary

Aurora Global Database:

Primary
↓
replicate
Secondary
Secondary
↓
Promote
Application Region B
↓
Route 53 switch
↓
Users

4. Practical example

A business accepts at most 15 minutes of data loss and requires recovery within one hour, then selects and tests an appropriate strategy.

  • Internal applications can withstand long downtime: cross-Region backup and use CloudFormation + AMI to rebuild when needed.
  • Enterprise app needs to reduce DR costs but keep DB persistent: Pilot Light; need an app that is always available on a small scale: Warm Standby.
  • Service with high continuity requirements: production stacks in two Regions, Route 53 and Aurora Global Database with tested DB failover process.

5. Comparison

  • RPO limits data loss;
  • RTO limits recovery time;
  • in-Region HA does not automatically provide cross-Region DR.

RPO vs RTO

RPO = Recovery Point Objective = maximum amount of data loss accepted.

For example:

  • Backup every 1 hour
    → can take up to nearly 1 hour of data.
  • RTO = Recovery Time Objective = accept maximum system downtime.
  • Disaster time 10:00
    App works again 10:30
  • → RTO = 30 minutes
Recovery Point
↓
RPO
Disaster
↓
RTO
Application works again

RPO = how much data is lost. RTO = how long to down.

Backup vs Replication vs Failover

  • Backup = keep recovery point = return to previous state
  • Replication = copy data to recovery site = reduce RPO
  • Failover = move application/traffic to recovery site
Primary
↓
Replication
Secondary
↓
Failover
Users

Replication ≠ Backup

If you delete data by mistake:

Primary delete
↓
replication
Secondary can also be deleted

→ still need separate backup.

Multi-AZ vs Cross-Region DR

Multi-AZ = High Availability in a Region

AZ A
↓
fail
AZ B

Used to prevent: AZ failure

Cross-Region DR

Region A
↓
disaster
Region B

Region/site failure is larger

Multi-AZ = HA. Cross-Region = DR.

AWS Elastic Disaster Recovery (DRS)

1. Concept

DRS continuously replicates server data to AWS so recovery instances can launch after a source-system failure.

2. Purpose

Restore server from On-Prem / VM / other cloud to AWS when there is a disaster.

3. How it works

AWS Elastic Disaster Recovery (DRS)

  • Old name: CloudEndure Disaster Recovery

Key points:

Continuous replication
+
Low-cost staging
+
Disaster → launch Recovery EC2

How DRS works

  • Install AWS Replication Agent on the source server.

Agent replication changes at level disk block, should protect:

  • OS
  • Application
  • Database
  • Files
Source Server
↓
AWS Replication Agent
↓
Continuous Block Replication
↓
AWS Staging Area
↓ disaster
Recovery EC2

DRS replicates almost both server/disk, not just database.

Staging Area

Normally AWS only keeps a low-cost recovery environment:

Source
↓ replication
Staging Area
├─ small replication resources
└─ EBS replica

Khi disaster:

Staging Data
↓
Launch Recovery
↓
Production EC2 + EBS
  • → No need to run strong EC2 production 24/7, thus reducing costs.

Staging = a place to keep replicas for recovery, not to serve users.

DRS keeps server replicas in AWS; There was a problem and I turned on EC2 production for recovery.

RPO and RTO

  • Illustration source: Continuous replication → RPO at seconds
  • Failover → Minute level RTO

But actually depends:

  • network bandwidth
  • replication backlog
  • workload
  • application launch/test time

If the source writes data faster than the replication rate:

Replication Backlog ↑
↓
Actual RPO is worse

Failover and Failback

1. Failover

When the source site encounters a disaster:

Source ❌
↓
DRS Recovery Point
↓
Launch EC2/EBS
↓
Check Application
↓
Switch Traffic
2. Failback

When the source site is back up and running:

AWS Recovery Environment
↓
Failback
↓
Original Site

DRS supports both failover to AWS and failback to source.

Database and Application

DRS replicate disk block should be able to protect servers running:

  • Oracle
  • MySQL
  • SQL Server
  • SAP
  • enterprise applications
  • DRS does not automatically convert the database engine.

For example:

Oracle Source
↓ DRS
EC2 Recovery
↓
still requires an Oracle-compatible environment

Ransomware Recovery

  • Continuous replication: ≠ always have a clean copy.

If ransomware modifies data:

Source is encrypted ❌
↓ replication
Latest Copy can also be encrypted ❌
  • When recovering, you must choose: recovery point before ransomware occurs

Should still have:

  • backup retention
  • isolated backup
  • recovery point history
  • recovery testing

Replication ≠ Backup.

Recovery Environment still needs proper configuration

Recovery EC2 needs to be correct:

  • subnet
  • Security Group
  • instance size
  • dependencies
  • IAM permissions
  • KMS permissions

After launch, check:

EC2 Start
↓
Application Start
↓
DB Consistency
↓
Network Connectivity
↓
Switch Traffic
  • There is a recovery server: Does not mean the application is ready to serve users.

4. Practical example

A critical on-premises server replicates to AWS; after a data-center outage, the team launches EC2 recovery using its runbook.

1. On-Prem DR
On-Prem SAP / DB Server
↓ continuous replication
AWS Staging
↓ disaster
Recovery EC2
2. Cloud-to-AWS DR
Other Cloud
↓ DRS
AWS
3. Ransomware Recovery
Latest Data ❌
↓
Choose Clean Recovery Point
↓
Launch Recovery EC2
↓
Validate

5. Comparison

DRS targets disaster recovery; MGN targets planned migration and cutover; backups retain recovery points.

DRS vs Application Migration Service

The two services have quite similar flows:

Source
↓ Agent
Staging
↓
EC2 Target

But the purposes are different:

ServicePurpose
Elastic Disaster Recovery (DRS)DR, failover during disaster, can failback
Application Migration Service (MGN)Migration workload sang AWS

Remember: DRS = long-term protection + recovery in case of failure

MGN = migrate workload sang AWS

AWS DMS & SCT: database migrations

1. Concept

DMS migrates database data; SCT helps convert schemas and compatible code when changing database engines.

2. Purpose

Migrate database to AWS with low downtime.

3. How it works

  • DMS = DATA transfer · SCT = SCHEMA/CODE transfer when changing engine

For example:

Oracle
↓ SCT: convert schema
↓ DMS: migrate data
RDS MySQL

AWS Database Migration Service (DMS)

  • AWS DMS: Moves data between supported source and target databases, on premises or in AWS.
  • Source/target endpoint: Connection settings for the source and destination databases.
  • Replication task: Selects the data and migration method, such as an initial copy followed by ongoing changes (CDC).
  • DMS Provisioned: You select and manage the replication instance that performs the transfer.
  • DMS Serverless: AWS provisions and adjusts processing capacity. You still configure endpoints, the replication configuration, DCU limits, networking, credentials, and migration settings.
  • Requirements: The chosen deployment must support the databases and features you need.
Source DB
↓
DMS Replication Instance
↓
Target DB
On-Prem ↔ AWS
AWS → AWS
How to deployCapacity management
DMS ProvisionedYou choose Replication Instance (CPU/RAM) and actively change the instance class when you need to change capacity.
DMS ServerlessAWS self-provisions and adjusts replication capacity according to workload; No need to manage Replication Instance yourself.

Full Load + CDC

1. Full Load

Copy existing data:

Source
↓
Existing Data
↓
Target
2. CDC — Change Data Capture

After Full Load, continue replicating:

  • INSERT
  • UPDATE
  • DELETE
Source is still running
↓
Full Load
↓
Target has initial data
↓
CDC
↓
Target catches up with Source
↓
Cutover

Full Load = initial data. CDC = new changes.

  • → helps reduce downtime.

AWS SCT

  • SCT convert schema/database code when changing engine.

Can convert:

  • tables
  • views
  • schema
  • stored procedures/code when compatible
Oracle Schema
↓ SCT
MySQL Schema
  • Some engine-specific code may be required manual fix.

Migration Flow

For example Oracle On-Prem → RDS MySQL:

Oracle
├─ SCT → Convert Schema
│
└─ DMS
    ↓
Full Load + CDC
    ↓
RDS MySQL
  • Before cutover, make sure: The CDC has caught up + valid data/schema

DMS Multi-AZ

  • Multi-AZ provides HA for DMS Replication Instance.
Primary Replication Instance
↓ fail
Standby Instance

Multi-AZ = HA ≠ double throughput ≠ make Source/Target DB Multi-AZ

Network & Security

  • DMS must be able to connect: Source DB · ↕ · DMS · ↕ · Target DB

You may need:

  • VPN / Direct Connect
  • Route Table
  • Security Group
  • DB port
  • DB credentials

IAM permission to manage DMS ≠ database access permission.

RDS → Aurora

Can be used:

1. Snapshot
RDS Snapshot
↓
Aurora
  • Simple but doesn't replicate new writes.
2. Aurora Read Replica
RDS
↓ replication
Aurora Replica
↓
Promote
3. DMS
RDS
↓ Full Load + CDC
Aurora
  • → suitable when desired low downtime.

Other DMS Targets

  • DMS is not just DB → DB.

Can target:

  • S3
  • Redshift
  • DynamoDB
  • OpenSearch
  • Kinesis
  • Kafka
  • DocumentDB
Database
↓ DMS
S3 / Redshift

External DB → Aurora

If the source is still active and needs to synchronize changes:

External DB
↓
DMS + CDC
↓
Aurora

MySQL can also be migrated using backup/import like:

XtraBackup / mysqldump
↓
Aurora MySQL

4. Practical example

A company migrates Oracle to PostgreSQL, converts the schema, and uses full load plus CDC before cutover.

  • Oracle on-premises → RDS MySQL: SCT switches schema, DMS full load + CDC transfers data; cutover after the target catches up.
  • RDS MySQL/PostgreSQL → Aurora: choose snapshot when accepting restore from recovery point, replica when wanting to catch up with writes before promoting.
  • External MySQL → Aurora using Percona XtraBackup/S3 for large initial load; Use DMS when you need to migrate while the database is still active.
  • Replicate operational database to S3, Redshift or streaming target for analytics when the endpoint pair and data shape match.

5. Comparison

DMS moves data; SCT assists with schemas and code; MGN migrates servers; they address different layers.

Homogeneous vs Heterogeneous

1. Homogeneous

Same database engine:

PostgreSQL
↓ DMS
RDS PostgreSQL

→ usually just DMS.

2. Heterogeneous

Change engine:

Oracle
↓
MySQL

Need:

SCT → convert schema
DMS → migrate data

Same engine → DMS
Different engine → SCT + DMS

AWS Backup & Backup Vault Lock

1. Concept

AWS Backup centrally manages backup creation, retention, and copying across services.

2. Purpose

Manage and automate backups for multiple AWS services using a centralized policy.

3. How it works

Resources → Backup Plan → Backup Jobs → Backup Vault → Recovery Points

What does AWS Backup support?

  • Scheduled/on-demand backup: Backup scheduled or run immediately; Select resource by ID or tag.
  • Retention and lifecycle: Specify how long to keep backups and when to transfer to cold storage if the resource supports it.
  • Common resources: EC2/EBS, RDS/Aurora, S3, DynamoDB, EFS, FSx, DocumentDB/Neptune. PITR, cold storage and copy capabilities vary by service.

Plan, Vault and Recovery Point

  • Backup Plan = policy. Configure frequency, backup window, lifecycle, retention and resource assignment.
  • Backup Vault = place to manage backups. Recovery Point = version that can be used to restore.
  • Backing up more frequently creates recovery points closer together, helping to reduce RPO; still need to test restore to check RTO and recovery ability.
Plan: every 12 hours · keep for 30 days · apply tag Backup=Daily
↓
Selected Resources → Recovery Points in Vault

Copy to Region or another account

  • Cross-Region: Copy backup to another Region to recover when the source Region has problems.
  • Cross-account: Copy to backup account to increase isolation when production account is compromised.
  • Need correct vault policy, IAM/service role and KMS permissions; Check if the resource supports that type of copy.

PITR

  • Point-In-Time Recovery = restore to a specific point in time within the supported range. Only applies to supported services, not available for all resources.
10:36: data is still good
↓
10:37: error occurred
↓
PITR returns 10:36 if in recovery window

Backup Vault Lock

  • Backup Vault Lock: Locks backup retention rules against unauthorized deletion or shortening; this is often called WORM.
  • Governance mode: An identity with suitable permissions can still change or remove the lock.
  • Compliance mode: After the initial change window, the lock cannot be changed or removed; even root cannot bypass the locked retention period.
  • Example: A 90-day retention rule prevents an attacker from deleting protected backups early.
  • Remember: A lock does not prove the stored data is healthy. Keep several recovery points and test restores so you are not left only with backups of damaged data.

4. Practical example

A company schedules EC2 and RDS backups, copies them to a recovery account, and regularly tests restores.

  • Tag EC2/EBS/RDS to create a backup management plan for the entire environment.
  • DR: keep a copy in another Region; Increase isolation with a separate backup account.
  • Compliance/ransomware: Vault Lock keeps backups until the end of retention, choosing a recovery point before the incident when restoring.

5. Comparison

Backup Vault Lock protects backup retention; Object Lock protects S3 objects; replication does not replace recovery points.

AWS Application Discovery Service & Application Migration Service (MGN)

1. Concept

Discovery inventories servers and dependencies; MGN replicates and migrates servers to EC2 on a planned schedule.

2. Purpose

Survey the current system → monitor migration → rehost server to EC2.

3. How it works

Discovery Service
↓
Migration Hub
↓
MGN
↓
EC2

Application Discovery Service

  • Purpose: Learn the system before migrating.

Collect:

  • number of servers
  • CPU / RAM / Disk
  • utilization
  • server dependencies
  • Help: Right-size EC2 + divide migration waves + know which servers depend on each other
1. Agentless
  • Do not install agents on each server.
Agentless
→ inventory + utilization
→ suitable for quick survey of many VMs
2. Agent-based
  • Install Discovery Agent on the server.
  • Collect more: Processes + Network connections + Dependencies

For example:

Web
↓
App
↓
DB

Agentless = general. Agent-based = more detailed dependencies.

Migration Hub

  • Migration Hub = centralized place to view and track migrations.
Discovery Data
↓
Migration Hub
↓
Track applications / servers / progress

Used for:

  • xem discovery data
  • Group servers into applications
  • track migration progress

Migration Hub is not a tool to directly migrate servers.

Application Migration Service (MGN)

  • MGN = rehost / lift-and-shift server to EC2.

Support:

Physical Server
VM
Other Cloud
↓
AWS EC2
  • MGN installed AWS Replication Agent on source.
Source Server
↓
Replication Agent
↓
Continuous Replication
↓
Low-cost Staging
↓
Test
↓
Cutover
↓
EC2
  • Source can still run while replicating → reduce downtime.

Test & Cutover

1. Test

Launch EC2 test to test:

  • server boot
  • application
  • network
  • dependencies
2. Cutover

Once the target has caught up:

Source
↓
Final replication
↓
Launch Production EC2
↓
Validate
↓
Switch traffic

Minimal downtime ≠ zero downtime.

MGN = Rehost

MGN mainly keeps the same server:

On-Prem Server
↓ MGN
EC2 Server

MGN not self:

Oracle → Aurora ❌
Monolith → Lambda ❌
  • Change database engine: DMS + SCT

App2Container and AWS Transform

ServiceConcept
AWS App2Container (A2C)CLI tool analyzes legacy applications on servers and dependencies, creates Docker/container images and deployment artifacts for ECS/EKS; Supports compatible applications.
AWS TransformThe service uses AI agents to analyze, migrate and modernize applications, code, dependencies and infrastructure according to supported workloads.
App2Container
Legacy Application on the server
↓ containerize
Docker Containers → ECS/EKS

AWS Transform
Legacy Application / Infrastructure
↓ AI agents analysis + conversion
Modernized Solution on AWS
  • A2C focuses on containerization; Transform has a broader scope of modernization. MGN maintains the direction of rehosting the server to EC2; Don't turn monoliths into microservices yourself.
  • Service update: App2Container stopped accepting new customers from 07/11/2025; Existing customers can complete ongoing projects. AWS recommends Transform for new projects. ·

4. Practical example

A team assesses a server group, tests AWS copies, and schedules cutover after successful validation.

  • Inventory and dependency mapping for data center before dividing migration waves, choosing instance size and transfer order of application groups.
  • Rehost a legacy enterprise app from VMware/physical servers or another cloud to EC2 while keeping the OS/application stack.
  • Use Migration Hub to monitor multiple waves; Use MGN for servers and DMS/SCT for DB engine conversion in the same migration program.

5. Comparison

Discovery gathers information; MGN performs rehosting; DMS migrates database data.

MGN vs DRS

The two services have quite similar flows:

Source
↓ Agent
Staging
↓
EC2

But another purpose: MGN = Migration = move server to AWS

DRS = Disaster Recovery = keep the replica for recovery in case of failure

Compare options

ServiceRemember
Discovery ServiceSurvey server + dependencies
Migration HubTrack migrations
MGNRehost server → EC2
DMS + SCTMigrate database
DRSDisaster Recovery
App2ContainerLegacy application → Docker container
AWS TransformLegacy application / infrastructure → modernized solution using AI

Agentless vs Agent-based Discovery & Migration Hub Home Region

ConceptDistinguish
Agentless vs Agent-based DiscoveryAgentless deploys quickly via VMware vCenter connector (CPU/RAM/disk); Agent-based installed on each physical server/VM to collect in-depth process and network dependencies
Migration Hub Home Region vs Destination RegionHome Region just a central place to store discovery metadata and migration progress status; The actual server/database still moves directly to any location Destination Region Which destination?
Hybrid migration: VM Import/Export, bulk transfer & VMware Cloud on AWS

1. Concept

Choose migration tools based on the source: virtual machines, stored data, or a VMware environment.

2. Purpose

Choose how to migrate VM / large amounts of data / VMware workloads from On-Prem to AWS.

3. How it works

VM image → VM Import/Export
Bulk large data → Snowball
VMware workload → VMware Cloud on AWS

VM Import/Export

  • Purpose: Import existing VM to EC2 or export EC2 VM to On-Prem.
1. Import
VM Image
↓
S3
↓
VM Import/Export
↓
AMI
↓
EC2

Can be used to:

  • migrate VM to EC2
  • Save VM images for recovery/DR
  • test workload on AWS
2. Export
EC2
↓
Export VM Image
↓
On-Prem
  • Only supported when OS / image / licensing / format suitable.

VM Import/Export = migration by image. MGN = continuous replication of the running server.

Amazon Linux VM Image

Amazon Linux can run On-Prem on hypervisors such as:

  • VMware
  • KVM
  • VirtualBox
  • Hyper-V

Note:

VM image is not always the case .iso; format depends on hypervisor.

Bulk Data Transfer

When transferring very large datasets, you need to consider:

  • Data Size + Bandwidth + Setup Time

For example 200 TB:

WayMain idea
Internet/VPN 100 Mbps~185 ideal days
Direct Connect 1 Gbps~18.5 days of transmission, not including setup time
SnowballMay be faster for initial bulk load

This is an illustrative example only, not an SLA.

Snowball

  • Snowball = transferring large amounts of data using a physical device.
On-Prem Data
↓
Copy to Snowball
↓
Ship device
↓
AWS imports data

Suitable when:

Dataset is very large
+
WAN is slow
→ Transfer over network takes too long
  • Snowball mainly deals initial bulk load, not continuous replication.

Initial Load + Ongoing Changes

Can combine:

Initial Data
↓
Snowball
↓
AWS

New Changes
↓
VPN/Direct Connect
↓
DMS or DataSync
Database changes
→ DMS + CDC

Files / Storage
→ DataSync

After the target catches up:

Source
↓
Final sync
↓
Cutover
↓
AWS

VMware Cloud on AWS

  • Purpose: Run VMware workloads on AWS but keep the VMware stack.
On-Prem VMware
↓
VMware Cloud on AWS
├─ vSphere
├─ vSAN
└─ NSX
↓
AWS Services
1. Ingredients
VMware Stack componentsFunction
vSphere / vCenterRun hypervisor and centrally manage VM virtual machines
vSANSoftware-defined storage
NSXNetwork virtualization and security (Networking & Security)
  • using big VMware
  • Want to migrate/expand data center to AWS
  • still want to use vCenter/vSphere
  • Don't want to move workload to native EC2 yet

4. Practical example

A team needs to bring a supported VM image into EC2, so it evaluates VM Import rather than file-copy tools.

  • Import a supported VM image into EC2 or keep the repository for recovery without a continuous MGN pipeline.
  • Initial load 200 TB using Snowball with only 100 Mbps WAN, then continue updating via DMS/DataSync and VPN/DX.
  • Expand or migrate vSphere estate to AWS when the team needs to continue administration with vCenter/vSphere, and integrate S3, FSx, RDS or analytics services.

5. Comparison

VM Import handles VM images; MGN replicates servers; DataSync/Snow transfer data subject to capabilities and availability.

VMware Cloud vs MGN

1. VMware Cloud
VMware On-Prem
↓
VMware Cloud on AWS

→ keep VMware environment

2. MGN
Server / VM
↓
MGN
↓
Native EC2

→ rehost sang AWS EC2

VMware Cloud = keep VMware. MGN = switch to native EC2.

AWS Backup flashboard — SAA-C03

1. Concept

Backup mechanisms protect different data types; choose the right retention and recovery method.

2. Purpose

Compare backup and data protection mechanisms to choose the right recovery based on service, timing, and retention.

3. How it works

What data to backup?

Service / mechanismDataFunction / when selected
RDS Automated BackupsRDS databaseAutomatic backup + transaction logs; PITR support up to 35 days when enabled
Aurora Automated BackupsAurora clusterContinuous, incremental backup; PITR up to 35 days; always on
RDS / Aurora Manual SnapshotDatabaseCopy at a time, keep until actively deleted
Amazon Data Lifecycle Manager (DLM)EBS volumes / EBS-backed AMIsCreate, keep, and delete scheduled EBS snapshots/AMIs
EBS SnapshotEBS volumeBackup incremental; restore to new EBS volume
AWS BackupEBS, RDS, Aurora, EFS, DynamoDB, FSx, S3…Centralized management: schedule, retention, cross-Region/cross-account copy when resources support
AWS Backup Continuous BackupSupport resources like RDS, Aurora, S3PITR in recovery window is configured; Does not apply to all resources
S3 VersioningS3 objectsKeep multiple versions; Recover when overwritten/wrongly deleted if the required version is still available
S3 Replication (SRR/CRR)S3 objectsCopy to bucket of same Region or different Region
S3 Object LockS3 object versionsWORM: prevent version deletion/editing in retention; governance has appropriate bypass permissions
DynamoDB PITRDynamoDB tableContinuous backup; restore back in time within a maximum of 35 days to a new table
DynamoDB On-Demand BackupDynamoDB tableCreate full backups when needed, keep until deleted
EFS Automatic BackupEFS file systemAWS Backup automatically backs up according to the configured policy
  • Replication can propagate changes/deletions according to configuration, so backup/version history is still needed to go back to before the error.
  • Object Lock protects versions; Do not create an independent backup yourself.

Retention and characteristics

Backup typeRetention / characteristics
RDS AutomatedDB instance: 0–35 days, 0 is off; Multi-AZ DB cluster: 1–35 days
Aurora Automated1–35 days; Automated backups cannot be turned off
DynamoDB PITRRecovery window 1–35 days, default 35 when enabled
RDS / Aurora Manual SnapshotKeep until deleted
EBS SnapshotIncremental; Keep until deleted or processed by lifecycle policy
AWS Backup ContinuousPITR up to 35 days; depending on the configured service and retention
AWS Backup PeriodicRetention according to backup plan; Supports long-term storage, cold storage capabilities depending on resources
  • AWS Backup continuous supports RDS instances/Aurora accordingly, but does not support RDS Multi-AZ DB clusters.
  • Copy continuous backup to another Region/account to create a snapshot copy, without keeping the PITR window of the source copy.

· · ·

4. Practical example

After accidental table deletion, the team selects a pre-incident recovery point and restores to a new resource for validation.

  • Wrongly deleting database data: PITR forward error if still in recovery window.
  • Backup EBS daily and keep for 7 days: DLM; Many services/accounts need common management: AWS Backup.
  • Save database copies for many months/years: manual snapshot or periodic backup with appropriate retention.
  • S3 overwritten: restore old version; Need to prevent version deletion according to retention: Object Lock with appropriate mode.

5. Comparison

Backups retain recovery points; archives prioritize long retention; replication maintains copies; DR covers both data and applications.

Well-Architected & Trusted Advisor

AWS Well-Architected Framework & Tool

1. Concept

Well-Architected provides questions and principles for reviewing architecture; the Tool records results, risks, and improvements.

2. Purpose

AWS Well-Architected Framework helps evaluate architecture according to best practices instead of just looking at individual services. AWS Well-Architected Tool turns that review process into trackable workloads, questions, risks, and improvement plans.

3. How it works

6 pillars

  • Operational excellence: Run systems well through monitoring, automation, and continual improvement.
  • Security: Protect identities, data, and systems; grant only the access needed.
  • Reliability: Keep applications working through failures and recover after incidents.
  • Performance efficiency: Choose the right resource types and amounts to meet performance needs.
  • Cost optimization: Meet requirements at a reasonable cost and avoid wasted resources.
  • Sustainability: Use resources efficiently to reduce environmental impact.
  • Application: Consider all six together; one change can improve several pillars or require balancing them.

Workload review

  • Workload: An application or business process made of resources and code, such as a shopping website or order processing system.
  • Review: Use structured questions to identify architectural strengths, risks, and improvements.
  • Tool's role: Records answers and tracks decisions; it does not fix the system automatically or replace architectural judgment.
Define workload
↓
Select lens
↓
Answer review questions
↓
Identify high / medium risks
↓
Improvement plan

AWS Well-Architected Tool

  • Well-Architected Tool is a free service in AWS Console to review workloads according to 6 pillars and related lenses.
Console
↓
AWS Well-Architected Tool
↓
Workloads
↓
Reports / Dashboard / Improvement plan
  • Common process: Select workload · Answer questions · Review results by pillar · Generate report · Track improvement status
  • Dashboard displays total workload and number of high/medium risk issues; Report helps share results with people who are not directly accessing the tool. AWS WA Tool

Access and scope

  • IAM controls who can create, view, edit, or share review workloads.
  • Review answers are architectural information, so do not enter unnecessary secrets, passwords or sensitive data.
  • The tool mainly works on metadata and review responses; it does not install agents into your workload and does not grant data-plane permissions to your application.
  • Console/API access using TLS;
  • The power to improve the actual architecture still lies with the target services such as IAM, VPC, RDS, S3 or CloudFormation.

4. Practical example

Before expanding production, a team reviews its workload against six pillars and tracks outstanding improvements.

  • Review a workload before production launch to find high risk issues regarding security, reliability or cost.
  • Track architectural improvements each sprint using improvement plans and milestone/report.
  • Standardize reviews of multiple workloads within an organization, instead of each team using its own checklist.

5. Comparison

Well-Architected reviews workload design; Trusted Advisor provides checks and recommendations for supported accounts and resources.

AWS Trusted Advisor

1. Concept

Trusted Advisor checks an AWS environment and recommends improvements through supported check categories.

2. Purpose

AWS Trusted Advisor audits accounts at a high level and provides recommendations to improve costs, security, performance, fault tolerance, service quotas, and operations.

3. How it works

Account assessment

  • Trusted Advisor: Checks resource configuration and state to recommend improvements in an AWS account; no EC2 agent is required.
  • Examples: A public snapshot, root access keys, a nearly exhausted quota, or resources that could cost less.
  • Your action: Review recommendations and choose changes appropriate for the application.
  • Comparison: It advises; it does not block every incorrect configuration at resource creation like an enforced guardrail.
AWS account
↓
Trusted Advisor checks
↓
Recommendations
↓
Review / remediate

Check categories

  • Common main categories: Cost Optimization · Performance · Security · Fault Tolerance · Service Quotas · Operational Excellence
CategoryArchitectural example
SecurityCheck for risky public or credential configurations.
Fault ToleranceRemind the design to be more fault tolerant, for example backup or Multi-AZ are suitable.
Service QuotasWarning about quota almost running out before scaling gets stuck.
Cost OptimizationFind idle resources or more economical options.

Support plan and API

  • In the console, the level of checks available depends on the support plan.
  • Full check set and permission to use Trusted Advisor/Support API require appropriate support plan such as Business Support+, Enterprise Support or Unified Operations.
  • Programmatic access is useful when you want to get recommendations for multiple accounts or integrate with internal dashboards. Trusted Advisor API
Trusted Advisor API
↓
List checks / recommendations
↓
Aggregate by account
↓
Remediation workflow

Access and security

  • IAM controls who can see the Trusted Advisor and call the API.
  • With multiple accounts, administrators often aggregate data through AWS Organizations and appropriate cross-account permissions.
  • Trusted Advisor recommendations may contain resource configuration information, so view permissions should only be granted to those who need to operate them.
  • Console/API access using TLS; True remediation still requires permissions on the target service.

4. Practical example

Operations reviews unused resources and configuration risks, validating each recommendation before applying changes.

  • Account review periodically to detect S3/EBS/RDS public exposure, quotas are about to be full or resources are costing money.
  • Security team gathers Trusted Advisor findings from multiple accounts to prioritize remediation.
  • Before scaling a workload, check service quotas and fault-tolerance recommendations to avoid errors when increasing load.

5. Comparison

Trusted Advisor provides recommendations; Config evaluates configuration rules; Compute Optimizer focuses on usage-based rightsizing.

Governance, Cost & Other Services

AWS CloudFormation

1. Concept

CloudFormation uses templates to create and update AWS resources consistently instead of configuring each resource manually.

2. Purpose

Write AWS infrastructure into code to create/update resources automatically, instead of manually configuring on Console.

3. How it works

YAML / JSON Template
↓
CloudFormation
↓
Stack
↓
AWS Resources

Templates and Stack

  • Template = YAML/JSON file describing the infrastructure to create.

For example:

  • VPC · EC2 · ALB · RDS
  • Stack = real resources created by CloudFormation from templates.
  • The same template can be used for: Dev · Test · Prod

Common parts:

  • Resources = resource to create

  • Parameters = input

  • Outputs = output, for example endpoint

  • Conditions = condition whether to create a resource or not

Change Set and Rollback

  • Change set: Previews which resources CloudFormation will add, modify, delete, or replace before a stack update.
  • Rollback: If an update fails, CloudFormation attempts to restore the stack's previous state; this is not a data backup.
  • DeletionPolicy Retain: Keeps the configured resource when deleting the stack.
  • DeletionPolicy Snapshot: Takes a snapshot before deletion if the resource type supports it.

StackSets

= deploy the same CloudFormation template to:

  • Multiple AWS Accounts · + · Multiple Regions
  • Suitable for AWS Organizations / multi-account.

Drift Detection

  • Drift = The real resource is edited differently from the template.

For example:

Templates:
SG permit 443

Someone edit Console:
SG allow 22

→ Drift
  • Drift Detection help detect that difference.

Infrastructure Composer and Service Role

  • Infrastructure Composer = intuitive interface for designing CloudFormation templates.

Service Role = IAM Role that CloudFormation uses to:

  • Create · Update · Delete
  • AWS resources.

4. Practical example

A team uses one template for test and production environments and reviews change sets before updates.

5. Comparison

A template describes infrastructure; a stack is a deployment; StackSets deploy stacks across accounts or Regions.

Amazon SES & Amazon Pinpoint

1. Concept

SES sends and receives application email; Pinpoint is a legacy customer-engagement service whose support has ended.

2. Purpose

Send application transactions and notifications by email without operating a mail server.

3. How it works

  • Amazon Pinpoint reached end of support on October 30, 2026.
  • Its content below describes legacy functionality; related messaging channels continue under AWS End User Messaging.
  • SES remains a separate email service.
  • SES = send/receive email for application
  • Pinpoint = in old documents, used to divide customer groups and run campaigns

SES = Email service Pinpoint = Customer segment + Campaign

Amazon SES

  • SES = Simple Email Service

Used to send email applications such as:

  • registration confirmation
  • reset password
  • invoice
  • newsletter

Flow:

Application / Lambda
↓
SES API / SMTP
↓
Email
↓
User
  • SES helps eliminate the need to operate the mail server yourself.

SES, not Gmail/Outlook, has an inbox interface for users.

Verified Identity and Sandbox

If you want to send email using SES, you must verify:

  • email address
  • or domains
  • Sandbox = initial limit mode.

In the sandbox, you can usually only send to:

  • Verified email/domain
  • mailbox simulator

When available Production Access:

  • No need to verify recipient; still have to verify the sender

Sender always needs Verified Identity.

Amazon Pinpoint

In old documentation: Pinpoint = used to:

  • divide customer groups (segments)
  • create campaign (campaigns)
  • create customer journeys
  • engagement tracking

For example:

The customer has not yet made a purchase
↓
Segment
↓
Discount campaign
↓
Email/SMS/Push

Different:

SES = send email Pinpoint = select customer group + run campaign

  • Pinpoints in this document are mainly important to remember to distinguish roles from SES.

4. Practical example

A website sends registration confirmations through SES using a verified sender domain.

5. Comparison

SES provides application email; Pinpoint historically managed segments and campaigns rather than user inboxes.

AWS Systems Manager

1. Concept

Systems Manager remotely manages and automates operations on nodes with the required agent, permissions, and connectivity.

2. Purpose

Remotely administer EC2 and external AWS servers without having to manually SSH each machine.

3. How it works

Systems Manager
↓
SSM Agent + IAM + Network
↓
Managed Nodes
↓
Session / Command / Patch / Automation

Conditions for machine management

Machine needs:

  • SSM Agent

  • IAM permission is appropriate

  • Connect to Systems Manager

  • EC2 private subnet is still usable, you can pass VPC Endpoint.

No need to public IP or open port 22 to use Systems Manager only.

Session Manager

  • Session Manager: Opens a command-line session to managed EC2 instances or servers from the AWS console/CLI.
  • Benefits: No SSH keys, bastion host, or inbound port 22 on the instance are required.
  • Requirements: The instance needs SSM Agent, IAM permissions, and connectivity to the required Systems Manager endpoints.
  • Example: An administrator inspects logs on a private EC2 instance without exposing it publicly.
Admin
↓
Session Manager
↓
Private EC2

Run Command

  • Run Command: Runs commands remotely on one or more Systems Manager managed nodes.
  • Example: Send one command to restart a service on 100 EC2 instances instead of logging in to each.
  • Typical tasks: Run scripts, restart services, or install software.
100 EC2
↓
Run Command
↓
restart service

Patch Manager

  • Patch Manager: Checks which operating system patches are missing and installs eligible patches.
  • Patch baseline: Rules defining which patches are approved for installation.
  • Example: Scan EC2 instances, identify missing security patches, and install them in the selected maintenance window.
EC2
↓ Scan
Patch Manager
↓
Detect missing patch
↓ Install
Install patches

Maintenance Windows

  • Maintenance window: A scheduled period in which maintenance tasks may run.
  • Example: Install patches or restart services only on Sunday from 02:00 to 04:00.
  • Comparison: Patch Manager handles patches; a maintenance window schedules when tasks run.
Sunday
02:00 - 04:00
↓
Patch / Restart / Run Command

Automation

  • Automation Runbook is a multi-step automation script AWS Systems Manager Automation execute in a specified sequence/flow to manage AWS resources.
  • Instead of the admin manually manipulating each step, the runbook runs the entire process itself;
  • can call AWS API, run script, wait or request approval.

For example:

Create AMI
↓
Stop EC2
↓
Update Config
↓
Start EC2
↓
Verify

Automation = automating a multi-step process.

State Manager

  • State Manager: Maintains the desired configuration through associations running on a schedule or supported events.
  • Example: Require CloudWatch Agent on EC2; State Manager applies the configuration to install the agent when needed.
  • Memory aid: Define the desired state, then use State Manager to check and apply that configuration on the configured schedule.
Desired:
CloudWatch Agent must be installed

Actual:
EC2 does not have an Agent yet

↓
State Manager

→ return the device to the desired state

Operating conditions

  • Automation's Execution role must have permissions for each target service; Not every step requires SSM Agent on the device.
  • Session Manager can logs to S3/CloudWatch Logs when configured, but SSH tunnel/port forwarding content is not logged this way.
  • Run Command supports concurrency limits/error thresholds; Patch Manager is not used to upgrade major OS versions.

4. Practical example

Operations accesses private EC2 instances with Session Manager and patches them during a maintenance window.

Runbook creates AMI, updates configuration, and verifies EC2; Maintenance Window selects running hours; The State Manager keeps the CloudWatch Agent installed.

5. Comparison

Session Manager provides access sessions; Run Command runs commands; Automation executes runbooks; State Manager maintains configuration.

AWS Cost Explorer, Budgets & Cost Anomaly Detection

1. Concept

Cost tools show spending, set budgets, and detect unusual increases in charges.

2. Purpose

Track expenses, set budgets, and detect unusual spending.

3. How it works

  • Cost Explorer = Where was the money spent?
  • Budgets = Is the set limit exceeded?
  • Cost Anomaly Detection = Are the costs unusual?

Cost Explorer

  • Cost Explorer = view and analyze AWS costs.

You can filter/group by:

  • Service

  • Account

  • Region

  • Tags

For example:

Bill increased
↓
Cost Explorer
↓
EC2 increase?
Data Transfer increased?
S3 increased?
  • Yes Forecast to predict future costs based on previous data.

Cost Explorer = cost analysis and trends.

Savings Plans Recommendations

Cost Explorer can analyze usage and:

  • Suggested Savings Plans; to reduce costs if the workload is stable.

Yes:

  • Coverage = how much usage is covered by Savings Plan

  • Utilization = how much of the committed portion is used

This is just recommendation, do not purchase the Savings Plan yourself.

AWS Budgets

  • Budgets = set cost/usage thresholds and alert when they are near or exceeded.

For example:

Monthly Budget = $500

Forecast > $500
↓
Send Alert

You can alert according to:

  • Actual cost

  • Forecast cost

Note:

Budgets don't automatically block costs just because you create them.

  • Configurable Budget Actions to perform some action when a threshold is reached.

Cost Anomaly Detection

  • Cost Anomaly Detection = use machine learning to detect unusual cost increases.

For example:

Normal Data Transfer = $20/day

Today = $150/day
↓
Anomaly Detection
↓
Alert

Other Budget:

  • Budget = exceeds the threshold I set? Anomaly Detection = unusually different from the normal pattern?

Abnormalities can be detected even when the total cost has not exceeded the budget.

AWS Compute Optimizer

  • Compute Optimizer: Uses configuration and utilization data to recommend better-sized resources, such as a smaller EC2 instance when capacity is wasted.
  • Requirements: Opt in and provide enough monitoring history. EC2 memory data requires an agent or another supported source.
  • Before changing: Review peak demand, memory, networking, and storage; 10% average CPU alone does not identify the right smaller instance.
  • Applying changes: These are primarily recommendations; the service does not resize EC2/EBS automatically by default.
EC2 m5.2xlarge is rarely used
↓ CPU / memory if available / network / IOPS / throughput
Compute Optimizer
↓ Illustrative recommendation: m5.large if it meets the workload
Review peak load and application requirements
↓
Change configuration to reduce costs
ResourceRecommended
EC2Instance type/size is appropriate
Auto Scaling GroupRightsizing compute by ASG
EBSVolume type, IOPS, throughput
LambdaMemory is suitable
ECS FargateCPU and memory
RDS / AuroraConfigure the database appropriately
DynamoDB, NAT Gateway, ElastiCacheOptimized according to the capabilities and conditions of each supported resource

Cost Management Ecosystem, Budgets Actions, Savings Plans & Reserved Capacity

Billing & Cost ToolsSpecialized roles
Cost and Usage Report (CUR) / AWS Data ExportsExport the most detailed cost & usage reports (by hour/resource/tag) to S3 for analysis Athena or QuickSight
Cost Allocation Tags & Cost CategoriesTags label cost allocation by project/department; Cost Categories group costs according to a set of logical rules
AWS Pricing CalculatorEstimate architectural costs before deployment
AWS Billing ConductorCreate custom price lists (proforma billing, plus separate markup/discounts) for service Chargeback / Showback internally without changing the original AWS invoice collected at the Management Account
Cost Optimization HubCentralize, de-duplicate and prioritize all savings proposals (idle, rightsizing, RI/SP) across multiple Accounts/Regions
Instance Scheduler on AWSThe available CloudFormation solution automatically turns on/off EC2 and RDS according to the tagging schedule (for example, only running Dev/Test environment office hours)
  • AWS Budgets Actions: Goes beyond standard email alerts — when a budget threshold is reached, it will automatically (or wait for approval) be executed Apply IAM Policy, Apply SCP, or Stop EC2 / RDS Instances specify.
4 Types of AWS Savings PlansFlexible rangeTerm
Compute Savings PlansMost flexible: self-applied throughout EC2, AWS Fargate, and AWS Lambda (Can change Region, instance family, OS, tenancy)1 or 3 years
EC2 Instance Savings PlansDeeper drop on EC2 but fixed one Instance Family + Region (can still change AZ, size, OS)1 or 3 years
SageMaker AI Savings PlansApplies to eligible SageMaker AI compute components1 or 3 years
Database Savings PlansHourly commitments for qualified DB services (Aurora Serverless v2, next generation RDS/Aurora support, DynamoDB, ElastiCache, OpenSearch, DMS…)1 year
  • Reserved Instances / Reserved Capacity (1 or 3 years): Apply separately for each service such as EC2 RI, RDS/Aurora Reserved DB Instances, DynamoDB Reserved Capacity (RCU/WCU), ElastiCache/MemoryDB/Redshift Reserved Nodes and Redshift Serverless Reservations (RPU). In Organizations, Consolidated Billing shares Discount offers RI/SP between member accounts but does not share Zonal RI capacity reservation rights under this billing mechanism.

4. Practical example

Anomaly detection flags a bill spike; the team uses Cost Explorer to identify the responsible service.

If the bill increases, use Cost Explorer to find the service/account causing the increase; If you want to warn about budget overruns, use Budgets; If you want to rightsize EC2/EBS according to usage, see Compute Optimizer and check your workload before applying.

5. Comparison

Cost Explorer analyzes spending; Budgets tracks configured thresholds; anomaly detection identifies unexpected spending patterns.

Compare tools

ServiceFunction
CloudWatchCollect metrics/logs, monitor performance and alarms
Compute OptimizerAnalyze metrics/configuration and recommend resource optimization
Cost ExplorerAnalyze costs/usage and trends
BudgetsActual/forecast alerts according to set thresholds
Cost Anomaly DetectionDetect costs that are unusual compared to the pattern
Data Lifecycle ManagerAutomatically manage scheduled EBS snapshots / EBS-backed AMIs
  • Billing data has latency.
  • Forecasts are forecasts, not guaranteed prices; See upcoming needs before purchasing Savings Plans.
  • Budget Actions need their own IAM role/permissions; Permission to view invoices does not automatically grant permission to stop EC2.
AWS Outposts

1. Concept

Outposts places AWS-managed infrastructure at your site and connects it to an AWS Region.

2. Purpose

Bringing AWS infrastructure to the business's datacenter to run workloads on-site but still using the familiar management method of AWS.

3. How it works

AWS Region
↕ Service Link
AWS Outposts at Datacenter
↓
Local Workloads

What is AWS Outposts?

  • Outposts = AWS hardware is set right at your datacenter.
  • Can run some supported AWS resources on-prem.

Suitable when needed:

  • low latency with local system

  • Process/save data at specific location

  • still want to use AWS tools/API

Not all AWS services can run on Outposts.

Connect to AWS Region

Outposts still connect back AWS Region cha via:

  • Service Link
Outposts
↓ Service Link
AWS Region
  • Service Link is used for traffic management and connection to AWS Region.

Outposts is not a standalone AWS cloud that is completely offline.

Responsibility

  • AWS = Outposts infrastructure management.

Enterprise = prepare:

  • datacenter

  • electricity

  • cooling

  • network

  • application/data

  • IAM, Security Group and encryption still need normal configuration.

4. Practical example

A factory evaluates Outposts for processing near equipment while retaining AWS operating models.

5. Comparison

Outposts brings compute/storage on premises; Direct Connect provides connectivity; Storage Gateway provides hybrid storage access.

Outposts vs Direct Connect vs Storage Gateway

ServiceWhat to use?
OutpostsRun AWS compute/resources right at the datacenter
Direct ConnectPrivate network line from on-prem to AWS
Storage GatewayConnect on-prem storage to AWS storage

Remember:

Outposts
= AWS runs at On-Prem

Direct Connect
= On-Prem connection ↔ AWS

Storage Gateway
= connect Storage On-Prem ↔ AWS
AWS Batch

1. Concept

AWS Batch schedules and provides compute for batch jobs, such as processing many image files.

2. Purpose

Run large batch jobs without having to manage the server/scheduler yourself.

3. How it works

Job Definition
↓
Submit Job
↓
Job Queue
↓
Scheduler
↓
Compute Environment
↓
Container Job

Main ingredients

Job Definition = configure how the job will run:

  • Container image
  • Command
  • CPU / RAM
  • IAM Role
  • Job = a particular run.
  • Job Queue = queue contains jobs that have not yet run.
  • Compute Environment = resources used to run the job, usually:
  • EC2
  • Fargate
  • EC2 Spot if the job can withstand interruption

For example:

1000 images need to be processed
↓
Submit 1000 Jobs
↓
Job Queue
↓
AWS Batch provides compute on its own
↓
Containers handled
↓
Output → S3

AWS Batch = Queue + Scheduler + Compute for batch jobs.

IAM

  • Job Role = permissions of the code inside the container.

For example:

Batch Job
↓ Job Role
S3 Read / Write
  • Permission to submit Batch job does not mean the container itself has access to S3.

4. Practical example

Thousands of video files enter a job queue; Batch allocates compute and runs jobs according to resource requirements.

5. Comparison

Batch manages job queues and scheduling; Fargate provides container compute; Lambda runs event-driven functions with its own limits.

Batch vs Lambda vs Fargate

  • AWS Batch = coordinate multiple batch jobs, suitable for heavy/long-running jobs.
  • Lambda = event-driven function, suitable for short tasks; Maximum normal lambda 15 minutes.
  • Fargate = where containers run without server management; can do compute under AWS Batch.

Batch = job management / queue / scheduling Fargate = provides compute for the container to run

Multi-Node Parallel (MNP) & Batch Scheduling Policy vs EventBridge Scheduler

Mechanism on AWS BatchFunctions & Limitations to remember
Multi-Node Parallel (MNP)Allows a large HPC/ML job to run simultaneously on multiple EC2 nodes coordinating via MPI (main node coordinates child nodes); Not supported on Fargate
AWS Batch Scheduling PolicyFair-share and prioritize resources among job groups in the Job Queue (no cron timer)
Amazon EventBridge SchedulerDecision time Trigger a job to run periodically (e.g. every day at 8:00 a.m. send the job to AWS Batch or ECS)
Amazon AppFlow

1. Concept

AppFlow transfers data between SaaS applications such as Salesforce and supported AWS services.

2. Purpose

Transfer data between SaaS applications and AWS services without writing a lot of integration code yourself.

3. How it works

SaaS / AWS Source
↓
AppFlow
↓ filter / map / transform
Destination

For example:

Salesforce
↓
AppFlow
↓
S3 / Redshift

Source and Destination

  • AppFlow uses connector to connect source/destination.

Possible:

  • map fields

  • filter data

  • validation

  • transform is simple

  • Not all connectors support all transmission directions.

AppFlow = managed data flow between SaaS ↔ AWS.

When does Flow run?

  • On Demand = runs when the user calls
  • Schedule = run periodically
  • Event = runs when source has change event and connector support

For example:

Salesforce update
↓
AppFlow
↓
S3

Scheduled flows can:

  • Full = get all data

  • Incremental = only get new/changed data

Security

AppFlow supports:

  • encryption in transit

  • encryption at rest

  • IAM

  • KMS

  • SaaS credentials / OAuth

  • If destination is S3/Redshift, appropriate permissions are still needed.
  • PrivateLink only applies when the connector supports it.

4. Practical example

Salesforce data is transferred to S3 on a schedule for analytics.

5. Comparison

AppFlow serves SaaS integration; Glue performs ETL/data integration; DMS focuses on database data migration.

AppFlow vs Glue vs DMS

  • AppFlow = Simple SaaS integration
  • Glue = ETL / transform data is more complicated
  • DMS = migrate/replicate database

For example:

Salesforce
↓ AppFlow
S3
↓ Glue
Transform Data
AWS Amplify

1. Concept

Amplify provides web/mobile development tools and website hosting on AWS.

2. Purpose

Help developers build and deploy web/mobile apps faster, including frontend hosting and AWS backend connection.

3. How it works

Git Repository
↓
Amplify Build / Deploy
↓
Hosted Frontend
↓
Auth / Data / Storage / Functions

Amplify Hosting

  • Amplify Hosting = build + deploy frontend from Git.

For example:

GitHub
↓ push code
Amplify
↓
Build + Deploy
↓
Website

Support:

  • CI/CD

  • HTTPS

  • Custom Domain

  • CDN

  • deploy according to branch

For example:

  • main = Production develop = Test

Amplify Hosting = frontend hosting + managed CI/CD.

Backend

Amplify helps connect AWS backends such as:

Amplify feature arrayAWS Services is behind
Auth (User login)Amazon Cognito
Data / API (Save & query)AWS AppSync / Amazon DynamoDB
Storage (Save file/media)Amazon S3
Functions (Backend logic)AWS Lambda

Flow:

Frontend
↓
Amplify
↓
Cognito / AppSync / DynamoDB / S3 / Lambda

Amplify is not a single server; it helps connect back-end AWS services.

4. Practical example

A frontend connects to a Git repository so releases build and deploy through Amplify Hosting.

5. Comparison

  • Amplify adds development and hosting workflows;
  • S3 plus CloudFront are separately configured storage and delivery components.

Amplify vs S3 + CloudFront

SolutionSupport range
AWS AmplifyBuilt-in Git CI/CD frontend hosting (for each branch) + quick connection to serverless backend ecosystem for web/mobile app
S3 + CloudFrontPure static hosting and CDN delivery; Need to assemble your own CI/CD pipeline and backend layer

Memory sentence: Amplify = frontend hosting + CI/CD + AWS backend connection for web/mobile app.

Amazon EventBridge Scheduler

1. Concept

EventBridge Scheduler invokes services once at a specified time or on a recurring schedule.

2. Purpose

Run tasks according to time/schedule without needing to maintain the cron server yourself.

3. How it works

Rate / Cron / One-time
↓
EventBridge Scheduler
↓
Execution Role
↓
Target

Schedule types

  • Rate = repeats after a period of time.

For example:

rate(5 minutes)

  • Cron = run on a specific schedule.

For example:

Every day 08:00

  • One-time = runs exactly once at the set time.

Rate = every time, Cron = any time according to the schedule, One-time = runs once.

Target and Execution Role

Scheduler can call:

  • Lambda
  • SQS
  • Step Functions
  • many other AWS APIs

Flow:

It's time
↓
Scheduler assumes Execution Role
↓
Call Target

Execution Role Must have appropriate permissions such as:

  • invoke Lambda
  • send message SQS
  • start Step Functions

Retry and DLQ

  • Retry: Calls the target again after a failed attempt.
  • DLQ: A queue that holds undelivered events for investigation and later processing.
  • Avoid duplicates: The target may be called again; use a request ID to avoid repeating an effect, such as sending the same invoice twice.
Scheduler
↓
Retry
↓ still fails
SQS DLQ

4. Practical example

A schedule invokes Lambda nightly to generate reports, with retries and a DLQ for target failures.

5. Comparison

Scheduler triggers by time; an EventBridge event bus reacts to events; Batch scheduling chooses job execution order.

Scheduler vs EventBridge Event Bus

Scheduler = trigger according time

For example:

Every night 01:00
↓
Run Lambda

EventBridge Event Bus = trigger according event

For example:

EC2 state changed
↓
EventBridge Rule
↓
Lambda
AWS AppConfig

1. Concept

AppConfig deploys configuration and feature flags with validation, gradual rollout, and rollback.

2. Purpose

Implement secure application configuration changes and feature flags with validation and automatic rollback without the need to build/deploy code again.

3. How it works

Protection layers during configuration rollout

ComponentProtection function
ValidatorsCheck syntax/semantics using JSON Schema or Lambda function before Enables configuration release
Deployment Strategy & Bake TimeRelease slowly at a rate (Linear, Canary) and then keep the follow-up period (Bake Time) after reaching 100%
CloudWatch Alarm + Auto RollbackAutomatically stops and returns to the previous stable configuration as soon as CloudWatch Alarm reports an increase in error rate/latency

4. Practical example

A team releases a feature to a subset of users and rolls configuration back when its CloudWatch alarm fires.

5. Comparison

Parameter Store stores values; AppConfig controls configuration deployment; Secrets Manager focuses on secrets and rotation.

Distinguish SSM Parameter Store vs AWS AppConfig

CriteriaSSM Parameter StoreAWS AppConfig
Main purposeStores configuration key-value pairs and secret strings (SecureString)Dynamic configuration distribution & feature flags Controlled operational risks
Validation, Gradual Rollout & Auto RollbackThere is no built-in canary/auto-rollback mechanism according to CloudWatch AlarmFull support schema/Lambda validation, canary/linear rollout, and automatic rollback
AWS Service Catalog, License Manager & AWS Managed Services (AMS)

1. Concept

Service Catalog provides approved infrastructure products, License Manager tracks licenses, and AMS operates AWS environments.

2. Purpose

Standardize the self-provisioning of approved infrastructure, software licensing control, and outsourcing the operation of multi-account enterprise environments.

3. How it works

AWS Service Catalog & AWS License Manager

Administration serviceMechanism of action & Distinguishing point
AWS Service CatalogManage approved infrastructure portfolio (Product written in CloudFormation compiled in Portfolio attach IAM permissions and launch constraints) for groups to create themselves Provisioned Product compliant with security standards/tags without needing permission to create raw resources or write your own IaC
AWS License ManagerCentralized management of commercial licenses (Oracle, Windows/SQL Server, SAP...) on both AWS and On-premises via License Configuration count and block exceeding the limit vCPU, Cores, Sockets or Instances (integrates EC2 Launch, Dedicated Hosts, Organizations)
Platform Admin defines CloudFormation Template → puts it into Service Catalog Portfolio → Developer selects allowed Products → creates standard-compliant AWS Resources

AWS Managed Services (AMS)

AMS Model/ComponentOperating range
AMS AccelerateAdd 24/7 monitoring, incident detection, patching and backup on existing environments; The customer team still directly changes the infrastructure
AMS Advanced & MALZOperate strictly on Multi-Account Landing Zone (MALZ); Infrastructure changes go through the process RFC (Request for Change) or approved self-service

4. Practical example

Employees provision environments from approved Service Catalog products with controlled permissions and configurations.

5. Comparison

  • Service Catalog governs approved provisioning;
  • License Manager handles licenses;
  • AMS supports operations within its service scope.