ข้ามไปยังเนื้อหา

Architecting on AWS 7.12.4 — Cheat Sheet

🧠 ภาพจำก่อนอ่าน: 🧠 Concept → 🗺️ Flow → 🔎 Check → ✅ Explain
🎨 Visual Guide ของวิชานี้ — ดูภาพช่วยจำ แล้วอ่านรายละเอียด/คำสั่งในบทนี้

สำหรับทบทวนเร็วจาก Note Module 1–13
Source basis: Architecting on AWS 7.12.4 Student Guide + 26 module notes
ใช้ไฟล์นี้เพื่อจำ mental model และเลือก service ให้ถูก ไม่ใช่แทน Note ฉบับเต็มทั้งหมด


Business requirement
↓
Constraints / risk / scale / latency / compliance / cost
↓
Architecture decision
↓
AWS services

Solutions Architect ต้องคิดจาก business needs และ requirements ก่อน แล้วค่อยเลือกบริการที่เหมาะ

Region
└─ Availability Zones
└─ Data Centers
  • Region = geographic area
  • Availability Zone (AZ) = fault-isolated location ภายใน Region
  • Multi-AZ design ใช้เพิ่ม High Availability
  • เลือก Region โดยพิจารณา governance/legal, latency, service availability และ cost
  • Local Zone = เอา compute/storage บางส่วนไปใกล้ผู้ใช้
  • Edge Location = จุดให้บริการ edge/CDN/DNS-related services ใกล้ผู้ใช้
  1. Operational Excellence
  2. Security
  3. Reliability
  4. Performance Efficiency
  5. Cost Optimization
  6. Sustainability

สิ่งที่ควรจำ: Least Privilege อยู่ใน Security pillar และ Well-Architected Review เป็นกระบวนการประเมิน/ปรับปรุงต่อเนื่อง


Principal
↓
Authentication
↓
Policy evaluation
↓
Allow / Deny
↓
AWS resource

Principal อาจเป็น IAM User, IAM Role, AWS service หรือ federated identity

Object ใช้เมื่อ
IAM User identity ระยะยาวสำหรับบุคคล/ระบบที่จำเป็นต้องมี user โดยตรง
IAM Group รวม users เพื่อจัด permission
IAM Role temporary credentials / delegation / service-to-service / cross-account

Role + STS/AssumeRole = pattern สำคัญสำหรับ temporary credentials

Explicit Deny > Allow

ถ้ามี Explicit Deny ที่ applicable → request ถูก deny แม้ policy อื่นมี Allow

Control หน้าที่
Identity-based policy grant permissions ให้ user/group/role
Resource-based policy grant permissions ที่ resource
Permissions Boundary กำหนด maximum permissions ของ identity
SCP กำหนด permission guardrail สำหรับ accounts/OUs ใน AWS Organizations

SCP ไม่ได้ grant permission — มันกำหนดเพดาน/ข้อจำกัดของสิทธิ์


Route table มีเส้นทางไป Internet Gateway (IGW)

ไม่มี direct route ไป IGW สำหรับ workload ทั่วไป

ถ้า private instance ต้องออก Internet:

Private EC2
↓
Private subnet route table
↓
NAT Gateway (อยู่ public subnet)
↓
Internet Gateway
↓
Internet

CIDR ใช้กำหนด address range ของ VPC/Subnet

ควรวาง IP plan ให้มีพื้นที่สำหรับ growth และหลีกเลี่ยง overlap โดยเฉพาะถ้าจะเชื่อม VPC หรือ hybrid network ภายหลัง

Security Group Network ACL
ระดับ ENI/instance ระดับ subnet
Stateful Stateless
Allow rules Allow + Deny rules
return traffic ถูกอนุญาตตาม state ต้องพิจารณา traffic ทั้งขาเข้าและขาออก

จำง่าย:

SG = stateful firewall รอบ workload
NACL = stateless filter รอบ subnet

คิดอย่างน้อยเรื่อง:

  • AMI
  • Instance type/family
  • Network/Subnet/Security Group
  • Storage
  • Key pair / access method
  • IAM Role
  • User Data
  • Placement / tenancy requirement
User Data Instance Metadata
ส่งข้อมูล/script เข้า instance ตอน launch instance อ่านข้อมูลเกี่ยวกับตัวเอง
ใช้ bootstrap/configuration ใช้ดู instance identity/config/network/IAM-related metadata

IMDS รุ่นใหม่ใช้ token flow เพื่อเพิ่ม protection ก่อนดึง metadata

EBS Instance Store
persistent/durable block storage temporary/ephemeral local storage
แยก lifecycle จาก EC2 ได้มากกว่า ผูกกับ host/instance lifecycle
ใช้กับข้อมูลที่ต้องเก็บ ใช้ scratch/cache/temp data ที่หายได้
  • On-Demand = flexibility สูง ไม่มี commitment
  • Savings Plans = commitment เพื่อประหยัดเมื่อ usage มีความสม่ำเสมอ
  • Spot = ราคาประหยัดมาก แต่ workload ต้องรับ interruption ได้

ใน architecture จริงสามารถผสมหลาย purchasing model ได้

Event
↓
Lambda function
↓
AWS services / application logic

Serverless ช่วยลดภาระ provisioning, scaling และ server management แต่ function ยังต้องมี IAM permissions เมื่อต้อง access resources


flowchart TD
    A[Need storage]
    B{Data model?}
    C[EBS]
    D[S3]
    E{Shared file workload?}
    F[EFS]
    G[FSx family]
    A --> B
    B -->|Block| C
    B -->|Object| D
    B -->|File| E
    E -->|Linux / NFS general shared file| F
    E -->|Windows / Lustre / ONTAP / OpenZFS| G
  • Object storage
  • Bucket → objects
  • Storage classes สำหรับ access/cost patterns ต่างกัน
  • Versioning = เก็บ object versions
  • Lifecycle = transition/delete objects ตามอายุ
  • CRR = Cross-Region Replication
  • Multipart Upload = large-object upload
  • Transfer Acceleration = ช่วย long-distance transfer ผ่าน edge network
  • Event Notifications = ทำให้ S3 เป็น event source
  • EFS = managed shared NFS file system สำหรับ Linux workloads
  • FSx = managed file systems สำหรับ workload เฉพาะ เช่น Windows File Server, Lustre, NetApp ONTAP, OpenZFS
Need Service
Online data movement AWS DataSync
Hybrid NFS/SMB/iSCSI/Tape interface AWS Storage Gateway
Dataset ใหญ่มาก / network ไม่เหมาะ AWS Snowball Edge

Need tables + relationships + relational model?
Yes -> RDS / Aurora
No / key-value / massive scale -> DynamoDB / purpose-built database
Feature Purpose
Multi-AZ High Availability / failover
Read Replica Read scaling

อย่าสลับกัน: Multi-AZ ไม่ได้มีไว้แก้ read scaling เป็นหลัก

  • MySQL/PostgreSQL compatible
  • cluster architecture
  • compute instances + shared cluster storage
  • Aurora Serverless v2 เหมาะเมื่อ demand เปลี่ยนและต้อง scale capacity อัตโนมัติ
DynamoDB
= fully managed NoSQL
+ key-value/document style
+ horizontal scale

หัวข้อที่ต้องจำ:

  • Partition key / composite primary key
  • Capacity modes
  • Eventually consistent vs strongly consistent reads
  • Global Tables สำหรับ multi-Region use case
  • DAX = cache ที่ออกแบบมาสำหรับ DynamoDB
  • ElastiCache = managed in-memory cache ทั่วไป
  • DAX = DynamoDB-focused cache

Caching patterns ในบท:

  • Lazy Loading
  • Write-through
  • TTL / eviction
  • AWS DMS = migrate/replicate database data
  • AWS Schema Conversion Tool (SCT) = ช่วย convert schema/code เมื่อ source/target engine ต่างกัน

Service ตอบคำถามอะไร
CloudWatch ระบบทำงานเป็นอย่างไร? metrics/logs/alarm
CloudTrail ใคร/อะไรเรียก AWS API อะไร เมื่อไหร่?
VPC Flow Logs network flow ถูก accept/reject อย่างไร?

Incident mental model:

Performance issue -> CloudWatch
Unexpected API change -> CloudTrail
Network connectivity issue -> VPC Flow Logs

Alarm ใช้ metric + threshold + evaluation periods / datapoints เพื่อเข้าสู่ state:

  • OK
  • ALARM
  • INSUFFICIENT_DATA

จากนั้น trigger notification/automation ได้

ใช้ event routing และ event-driven automation

Type จุดเด่น
ALB Layer 7, HTTP/HTTPS
NLB Layer 4, TCP/UDP, performance สูง
GWLB third-party virtual network appliances
Launch Template
+
Auto Scaling Group
+
Min / Desired / Max capacity
+
Scaling policy

มักทำงานร่วมกับ ELB + CloudWatch


Architecture definition
↓
JSON / YAML Template
↓
CloudFormation
↓
Stack
↓
AWS Resources

จำคำสำคัญ:

  • Template = desired infrastructure definition
  • Stack = resources ที่ CloudFormation manage เป็น unit
  • Change Set = preview changes ก่อน apply
  • Cross-stack reference = share outputs ระหว่าง stacks
  • Layered stacks = แยก lifecycle/ownership ของ architecture

ใช้ programming language define infrastructure แล้ว synthesize ไปสู่ CloudFormation model

ใช้ centralized operations/management สำหรับ resources ที่รองรับ

higher-level application deployment service ที่ลดภาระการประกอบ infrastructure หลายส่วนเอง


  • Microservices = architecture pattern
  • Containers = packaging/runtime mechanism
Monolith
↓
Microservices
↓
Container images
↓
Orchestration
↓
Independent deploy / scale
Service Role
ECR Container image registry
ECS AWS-native container orchestration
EKS Managed Kubernetes
Fargate Serverless compute engine for containers

Decision mental model:

Need Kubernetes API/ecosystem -> EKS
Need AWS-native orchestration -> ECS
Don't want to manage container hosts -> Fargate
Need host-level control -> EC2-backed containers

ใช้ให้ workload ใน VPC เข้าถึง supported AWS services แบบ private โดยลด dependency ต่อ Internet Gateway/NAT/Public IP สำหรับ traffic ที่รองรับ

Interface Endpoint ใช้ ENI + private IP + AWS PrivateLink

  • VPC-to-VPC แบบ one-to-one
  • CIDR ต้องไม่ overlap
  • ต้อง configure route tables
  • รองรับ cross-account / inter-Region ตาม use case
  • ไม่ transitive
A peers B
B peers C
ไม่ได้หมายความว่า A route ผ่าน B ไป C ได้
  • encrypted tunnels
  • ใช้ Internet-based connectivity
  • เหมาะกับเร็วต่อการเริ่มต้นและ encrypted hybrid connectivity
  • dedicated/private connectivity
  • เหมาะกับ requirement ด้าน predictable capacity/connectivity มากขึ้น
VPC A
|
VPC B -- TGW -- VPN / DX-related connectivity
|
VPC C
  • hub-and-spoke
  • attachments
  • Transit Gateway route tables
  • ทำ full connectivity, partial connectivity, isolation patterns ได้

จำเร็ว:

VPC -> AWS Service private = VPC Endpoint
VPC <-> VPC simple = VPC Peering
On-prem <-> AWS encrypted = Site-to-Site VPN
On-prem <-> AWS dedicated = Direct Connect
Many VPCs / central routing = Transit Gateway

Requirement Service
Managed API front door API Gateway
Async queue / buffering / decoupling SQS
Publish-subscribe / fan-out SNS
Continuous streaming data Kinesis
Multi-step workflow orchestration Step Functions
  • Standard = at-least-once, best-effort ordering
  • FIFO = ใช้เมื่อ ordering สำคัญ
  • Visibility Timeout = message ถูกซ่อนชั่วคราวระหว่าง consumer ประมวลผล
  • Long Polling = ลด empty responses/polling requests
Publisher
↓
SNS
↙ ↘
SQS A SQS B
↓ ↓
Consumer Consumer

ได้ทั้ง fan-out และ durable asynchronous processing

  • Kinesis Data Streams = streaming ingestion/processing
  • Data Firehose = managed delivery stream ไป destination

State machine ใช้ orchestrate steps, branching และ error handling ของ distributed workflow


Route 53 = DNS + traffic steering

  • Public Hosted Zone = internet DNS
  • Private Hosted Zone = DNS ภายใน associated VPCs
Policy ใช้เมื่อ
Simple single/simple destination
Failover active/passive
Geolocation route ตาม location ของ user
Geoproximity route ตาม geography ของ user/resource + bias
Latency-based route ไป Region ที่ latency ต่ำกว่า
Multivalue Answer return multiple healthy records
Weighted แบ่ง traffic ตามสัดส่วน/weight

CloudFront = CDN + edge cache

Viewer
↓
Edge Location
├─ Cache hit -> response
└─ Cache miss -> Origin -> cache -> response

จำต่างกัน:

  • Route 53 = ตัดสินใจ DNS/traffic ไปไหน
  • CloudFront = ทำ content delivery/caching ใกล้ user
Service Role
Shield DDoS protection
WAF inspect/filter HTTP(S) requests ตาม rules
Firewall Manager centralize security policies across accounts/resources

AWS infrastructure/services on premises สำหรับ requirement เช่น low latency, local processing หรือ data residency/locality


  • High Availability = ลด downtime และ recover/failover ได้เร็ว
  • Fault Tolerance = ระบบทน failure และทำงานต่อได้โดย interruption ต่ำมาก
  • Backup = สำเนาข้อมูลเพื่อ restore
  • Disaster Recovery = recovery plan สำหรับเหตุการณ์ใหญ่ที่กระทบ workload/site/Region
RPO = ยอมเสียข้อมูลย้อนหลังได้เท่าไร
RTO = ยอมให้บริการหยุดได้นานเท่าไร

ตัวอย่าง:

  • RPO 15 นาที = ยอมเสียข้อมูลล่าสุดได้สูงสุดประมาณ 15 นาที
  • RTO 1 ชั่วโมง = ต้องกู้บริการกลับภายในประมาณ 1 ชั่วโมง

เรียงจาก cost ต่ำ / recovery ช้า → cost สูง / recovery เร็ว

Backup & Restore
↓
Pilot Light
↓
Warm Standby
↓
Multi-site Active/Active
Strategy ภาพจำ
Backup & Restore เก็บ backup แล้วสร้างระบบเมื่อเกิดเหตุ
Pilot Light core components พร้อม แต่ application capacity ส่วนใหญ่สร้าง/scale ตอน failover
Warm Standby application ทำงานอยู่แบบ scale ต่ำ
Active/Active หลาย site/Region ให้บริการพร้อมกัน

สิ่งที่ต้องจำ:

  • Multi-AZ = HA pattern สำคัญ แต่ ไม่เท่ากับ cross-Region DR
  • IaC + AMI + automation ลด recovery time
  • DR plan ต้อง test จริง และอัปเดตต่อเนื่อง
  • AWS Backup ช่วย centralize/automate backup policies สำหรับ supported services

HA / failover -> Multi-AZ
Read scaling -> Read Replica
Security Group -> Stateful
NACL -> Stateless
DNS / traffic steering -> Route 53
CDN / edge caching -> CloudFront
Metrics / logs / alarm -> CloudWatch
API activity / audit history -> CloudTrail
Queue / decouple -> SQS
Publish / fan-out -> SNS
Simple one-to-one -> Peering
Many VPCs / central routing -> Transit Gateway
Private subnet general Internet egress -> NAT Gateway
Private access to supported AWS service -> VPC Endpoint
SCP = guardrail / maximum permission scope
SCP != permission grant
Multi-AZ = availability/failover
Backup = restore point
DR = broader recovery strategy

flowchart LR
    USER[Users]
    R53[Route 53]
    CF[CloudFront]
    WAF[WAF / Shield]
    ALB[ALB]
    APP[EC2 ASG / ECS-EKS / Lambda]
    DB[RDS-Aurora / DynamoDB]
    S3[S3 / EFS / FSx]
    CW[CloudWatch / CloudTrail]
    AUTO[CloudFormation / CDK]
    DR[Backup / DR]

    USER --> R53 --> CF --> WAF --> ALB --> APP
    APP --> DB
    APP --> S3
    APP --> CW
    AUTO --> APP
    AUTO --> DB
    DB --> DR
    S3 --> DR

เวลามอง architecture ให้ถามตามลำดับ:

  1. User เข้ามาทางไหน?
  2. DNS/edge/security อยู่ตรงไหน?
  3. Network boundaries เป็นอย่างไร?
  4. Compute แบบไหนเหมาะ?
  5. State/data อยู่ที่ไหน?
  6. Scale และ failover อย่างไร?
  7. Observe/audit อย่างไร?
  8. Deploy/rebuild ด้วย automation ได้หรือไม่?
  9. Backup/DR ตอบ RPO/RTO ได้หรือไม่?
  10. Architecture สอดคล้องกับ Well-Architected pillars หรือยัง?

ถ้ามีเวลาแค่ 15 นาที ให้จำชุดนี้:

6 Well-Architected Pillars
Explicit Deny > Allow
SCP does not grant permission
SG stateful / NACL stateless
Public subnet -> IGW
Private subnet Internet egress -> NAT GW
EBS persistent / Instance Store temporary
S3 object / EFS shared NFS / EBS block
RDS Multi-AZ = HA / Read Replica = scale reads
CloudWatch = observe / CloudTrail = audit / Flow Logs = network
ALB L7 / NLB L4
CloudFormation = IaC stack
ECS AWS-native / EKS Kubernetes / Fargate no host management
Peering not transitive / TGW central hub
SQS queue / SNS fan-out / Kinesis stream / Step Functions workflow
Route 53 DNS / CloudFront CDN / WAF HTTP filter / Shield DDoS
RPO data loss / RTO downtime
DR: Backup -> Pilot Light -> Warm Standby -> Active/Active

กลับไปที่ README.md แล้วเปิด Module ที่เกี่ยวข้อง หากข้อไหนใน Cheat Sheet ยังตอบว่า “ทำไม?” หรือ “ทำงานอย่างไร?” ไม่ได้ ควรกลับไปอ่าน Note Module นั้นก่อนทำ Knowledge Check


Cheat Sheet นี้ตั้งใจสรุป เฉพาะสิ่งที่รองรับโดย Student Guide/Notes ชุดนี้ และรักษ terminology/framing ตามหลักสูตร Architecting on AWS 7.12.4 จึงไม่ควรตีความว่าเป็นเอกสารอัปเดตฟีเจอร์ AWS ล่าสุดนอกหลักสูตร