AWS Organizations
AWS Organizations เป็น global service ที่ใช้จัดการหลาย AWS accounts จากจุดเดียว — บัญชีหลักเรียก Master Account (Management Account) และบัญชีอื่นๆ คือ Member Accounts
Consolidated Billing
รวมบิลทุก accounts เป็นใบเดียว — single payment สำหรับทุก member accounts
Pricing Benefits
Aggregated usage ทุก account ทำให้ได้ volume discount เร็วขึ้น (EC2, S3 ฯลฯ)
Pooling Reserved Instances
RI sharing ข้าม accounts ใน Organization — ใช้ประโยชน์ RI ได้คุ้มที่สุด
API + SCPs
API automate การสร้าง account ใหม่ + restrict permissions ผ่าน Service Control Policies
- Global service — ใช้ได้ทั่ว AWS regions
- Master Account = บัญชีที่สร้าง Organization เป็นคนจ่ายบิลรวม
- Member Accounts = บัญชีที่เข้าร่วม Organization
- ได้ Volume Discounts จาก aggregated usage (EC2, S3)
- Pool Reserved Instances ข้าม accounts ได้
- ใช้ API automate การสร้าง account ใหม่
- Restrict permission ของแต่ละ account/OU ด้วย SCPs
Multi-Account Strategies
การมีหลาย AWS accounts ช่วยแยกความรับผิดชอบและจัดการได้ดีกว่าใช้ account เดียว — มีหลายเหตุผลที่ควรแยก:
- แยกตาม department, cost center หรือ business unit
- แยก dev / test / prod environments
- แยกตาม regulatory restrictions (ใช้ SCP ควบคุม)
- Resource isolation (เช่น แยก VPC ให้ชัดเจน)
- Per-account service limits — แต่ละ account มี soft limits ของตัวเอง
- Isolated logging account สำหรับเก็บ logs ส่วนกลาง
Multi Account
แยก account ตาม environment/department — granularity สูง, security boundary ชัด, billing แยกตาม account
One Account Multi VPC
Account เดียวแต่หลาย VPC — จัดการง่ายกว่า แต่ blast radius ใหญ่กว่า ถ้า security incident จะกระทบหมด
- ใช้ tagging standards ที่สม่ำเสมอ — เช่น Environment, Project, Owner
- เปิด CloudTrail ทุก account แล้วส่ง CloudWatch Logs ไป central logging account
- ใช้ Cost Allocation Tags ทุก resource เพื่อ track ค่าใช้จ่าย
Service Control Policies (SCP)
Service Control Policies (SCPs) เป็น whitelist หรือ blacklist ของ IAM actions ที่ใช้ที่ระดับ OU หรือ Account ภายใน Organization — กำหนด permission boundary สูงสุดที่ account นั้นทำได้
- Apply ที่ OU level หรือ Account level (ไม่ใช่ user/role)
- ไม่มีผล กับ Master Account (Management Account) — เสมอมี full access
- มีผลกับ Users + Roles + Root user ของ member account
- ไม่มีผลกับ service-linked roles
- ต้องมี explicit Allow — ไม่มี allow by default (deny by default)
- SCP restrict permission แต่ไม่ grant — ต้องมี IAM policy allow ร่วมด้วย
Use Case: Restrict Services
ห้าม account ใน OU Production ใช้ EMR, SageMaker หรือ services ที่ไม่อนุญาต
Use Case: PCI Compliance
บังคับให้ account ที่อยู่ใน PCI environment ใช้ได้เฉพาะ services + regions ที่ผ่าน compliance
Use Case: Block Regions
อนุญาตให้ใช้เฉพาะ regions ที่กำหนด เพื่อ data sovereignty
Use Case: Force MFA
Block actions ที่อันตราย ถ้า user ไม่ได้ login ด้วย MFA
AWS Control Tower
AWS Control Tower เป็นวิธีที่ง่ายที่สุดในการ set up และ govern multi-account AWS environment — สร้าง landing zone ที่ปลอดภัย ปฏิบัติตาม best practices ภายในไม่กี่คลิก
- สร้างอยู่ บน AWS Organizations — ใช้ Organizations เป็น foundation
- Automate การ setup ของ environment ภายในไม่กี่คลิก
- Ongoing policy management ผ่าน Guardrails (preventive + detective)
- Detect + remediate policy violations โดยอัตโนมัติ
- Monitor compliance ผ่าน interactive dashboard
- เหมาะกับองค์กรที่ต้องการ secure multi-account setup แต่ไม่อยากเขียนทุกอย่างเอง
AWS Pricing Models (4 แบบ)
AWS มี 4 pricing models หลักที่ทำให้ลูกค้าจ่ายตามลักษณะการใช้งาน:
1. Pay as you go
จ่ายเฉพาะที่ใช้จริง — agile, responsive ปรับเปลี่ยนได้ทันที ไม่มี upfront
2. Save when you reserve
Reserved Instances สำหรับ EC2, DynamoDB, ElastiCache, RDS, Redshift — ลด risk, manage budget, รองรับ long-term needs
3. Pay less by using more
Volume-based discount — ยิ่งใช้เยอะยิ่งถูก เช่น S3 storage tiers
4. Pay less as AWS grows
AWS ลดราคาเรื่อยๆ ตามเวลา — ลูกค้าได้ราคาต่ำลงโดยไม่ต้องทำอะไร
Free Services & Free Tier
AWS มีหลายแบบของ "ฟรี" ที่ต้องแยกให้ออก:
Always Free Services
บริการที่ฟรีตลอด — IAM, VPC, Consolidated Billing (ไม่มีค่าใช้จ่ายของ service เอง)
Free Service, Pay for Resources
Service ฟรี แต่จ่ายค่า AWS resources ที่สร้างจาก service นั้น — Elastic Beanstalk, CloudFormation, Auto Scaling Groups
Free Tier (12 Months)
EC2 t2.micro 750 hrs/month นาน 12 เดือน, S3 5GB, EBS, ELB, data transfer ฟรีบางส่วน
- Always Free: IAM, VPC, Consolidated Billing — ไม่มีวันหมดอายุ
- Free Service (จ่ายเฉพาะ resources): Elastic Beanstalk, CloudFormation, ASG
- 12 Months Free: EC2 t2.micro, S3 Standard 5GB, ELB 750 hrs, data transfer
- หลังครบ 12 เดือน — ต้องจ่ายค่าใช้บริการตาม pricing ปกติ
Compute Pricing — EC2
EC2 charge ตามหลายปัจจัย:
- จำนวน instances
- Instance configuration: capacity, region, OS, instance type, instance size
- ELB running time + ปริมาณ data ที่ process
- Detailed monitoring (CloudWatch)
On-Demand
Linux billed per second, Windows billed per hour — ไม่มี commitment เปิด-ปิดเมื่อไรก็ได้
Reserved (1 / 3 yr)
ลดสูงสุด 75% เทียบ On-Demand — commit 1 หรือ 3 ปี เหมาะกับ steady workload
Spot Instances
ลดสูงสุด 90% — ใช้ spare capacity แต่อาจถูกหยุดได้ทันที เหมาะกับ batch/fault-tolerant
Dedicated Host
Physical server เฉพาะให้เรา — เหมาะกับ compliance, software licensing per-socket/core
Compute Pricing — Lambda & ECS
AWS Lambda
จ่ายตาม number of calls + duration (memory × time) — ไม่ต้องจ่ายเมื่อไม่มี request
ECS — EC2 Launch Type
ECS service ฟรี — จ่ายเฉพาะ AWS resources (EC2 instances, EBS volumes) ที่ใช้
ECS — Fargate Launch Type
Serverless containers — จ่ายตาม vCPU + memory ที่ allocate (ไม่ต้องจัดการ EC2)
- Lambda: pay per request + duration — มี free tier 1M requests/month + 400K GB-seconds
- ECS EC2 launch type: ECS เป็น free service, จ่ายเฉพาะ resources
- Fargate: pay per vCPU + memory ที่ allocate (per second)
Storage Pricing — S3
S3 charge ตามหลายปัจจัย — ต้องดูทั้ง storage class, ขนาด object, จำนวน requests และ data transfer:
- Storage class: Standard, Standard-IA, One Zone-IA, Glacier, Glacier Deep Archive
- Object size: ราคาถูกลงเมื่อใช้เยอะ (tiered pricing)
- Number + type of requests: GET, PUT, COPY, LIST ฯลฯ — ราคาต่างกันตาม operation
- Data Transfer OUT — outbound data ออกจาก S3 เสียเงิน (ตาม region)
- S3 Transfer Acceleration — มีค่าเพิ่มสำหรับ accelerated upload/download
- Lifecycle Transitions — เสียค่าธรรมเนียมเมื่อย้าย object ระหว่าง storage classes
Storage Pricing — EBS
- Volume type: gp2/gp3, io1/io2, st1, sc1, magnetic — ราคาต่างกัน
- Storage volume ในหน่วย GB/month ที่ provision (จ่ายตาม size ที่จองไว้ ไม่ใช่ที่ใช้จริง)
- IOPS: gp = รวมในราคา, io1 = จ่ายตาม IOPS ที่ provision, magnetic = จ่ายตาม number of requests
- Snapshots: per GB/month ที่เก็บ
- Data Transfer: Outbound = ราคา tiered, Inbound = ฟรี
Database Pricing — RDS
RDS charge ต่อชั่วโมง ตาม configuration ของ DB instance:
- Per hour billing ตาม instance ที่รันอยู่
- DB characteristics: engine (MySQL/Postgres/Oracle/SQL Server), size, memory class
- Purchase type: On-demand หรือ Reserved (1-3 ปี ได้ส่วนลด, ต้อง upfront)
- Backup storage: ฟรีถึง 100% ของ DB storage size ใน region — เกินต้องจ่าย
- Additional storage: per GB/month
- I/O requests: number of requests (สำหรับ บางประเภท storage)
- Single AZ vs Multi-AZ: Multi-AZ เสียมากขึ้น (มี standby instance)
- Data Transfer: Outbound tiered, Inbound ฟรี
Content Delivery Pricing — CloudFront
- Pricing ต่างกันตาม geographic region (อเมริกาเหนือ, ยุโรป, เอเชีย ฯลฯ)
- Aggregated per edge location
- Data Transfer Out มี volume discount (ยิ่งใช้เยอะยิ่งถูก)
- Number of HTTP/HTTPS requests
- ไม่มี minimum commitment — pay-as-you-go
Networking Costs in AWS
Networking มีหลายจุดที่ optimize cost ได้ — ต้องเข้าใจว่าใช้ Private IP vs Public IP ต่างกันยังไง:
Use Private IP
ประหยัดเงิน + performance ดีกว่า — ทราฟฟิกในเครือข่าย AWS internal
Use Public IP
เสียค่า data transfer มากขึ้น + performance อาจต่ำกว่า — ผ่าน public internet
Same AZ
ประหยัดสุด (บางครั้งฟรี) — แต่ ขาด HA (single AZ failure = ดับทั้งหมด)
Cross-AZ / Cross-Region
เสียค่า data transfer มากกว่า — แต่ได้ HA สูงขึ้น (trade-off ระหว่าง cost กับ resilience)
AWS Savings Plans
AWS Savings Plans = commit จำนวนเงิน ($/hour) เป็นเวลา 1 หรือ 3 ปี เพื่อแลกกับส่วนลด — flexible กว่า Reserved Instances
EC2 Savings Plan
ส่วนลดสูงสุด 72% — commit ที่ instance family ใน region (เช่น M5 ใน us-east-1) แต่ไม่สนใจ AZ / size / OS / tenancy
Compute Savings Plan
ส่วนลดสูงสุด 66% — flexible ที่สุด ไม่สน family / region / size / OS / tenancy / compute (ใช้กับ EC2, Fargate, Lambda)
- Setup ผ่าน AWS Cost Explorer
- Compute Savings Plan ครอบคลุม EC2 + Fargate + Lambda
- EC2 Savings Plan ครอบคลุมเฉพาะ EC2 — ส่วนลดเยอะกว่า แต่ flexible น้อยกว่า
- Commitment: 1 ปี หรือ 3 ปี — All Upfront / Partial Upfront / No Upfront
AWS Compute Optimizer
AWS Compute Optimizer ใช้ Machine Learning วิเคราะห์ configuration + CloudWatch metrics เพื่อแนะนำ optimal AWS resources — ลดต้นทุนและปรับปรุง performance
- ใช้ ML วิเคราะห์ configurations + CloudWatch metrics
- Supports: EC2 instances, EC2 Auto Scaling Groups, EBS volumes, Lambda functions
- ลดต้นทุนได้สูงสุด 25%
- Export recommendations ไปยัง S3 ได้
- ฟรี (ไม่มีค่าใช้จ่ายสำหรับ Compute Optimizer เอง)
Estimating Costs
TCO Calculator
เปรียบเทียบ on-premises vs AWS (Server, Storage, Network, IT Labor) — https://awstcocalculator.com
AWS Pricing Calculator
ประมาณค่าใช้จ่ายของ solution ที่จะ deploy บน AWS — https://calculator.aws/ (แทน Simple Monthly Calculator ที่เลิกใช้แล้ว)
- TCO Calculator: focus ที่การเปรียบเทียบ on-prem vs cloud — รวม cost ของ server, storage, network, IT labor
- AWS Pricing Calculator: focus ที่การประมาณค่าใช้จ่าย solution บน AWS
- Simple Monthly Calculator (เก่า) ถูก deprecate แล้ว — ใช้ AWS Pricing Calculator แทน
Tracking Costs
AWS มีหลายเครื่องมือสำหรับ track ค่าใช้จ่าย — แต่ละตัวเหมาะกับ use case ต่างกัน:
Billing Dashboard
ภาพรวมระดับสูง (high-level overview) + free tier dashboard — เห็น month-to-date spend
Cost Allocation Tags
AWS-generated (aws:) + User-defined (user:) — track ค่าใช้จ่ายในระดับละเอียด, ใช้ร่วมกับ Cost Explorer
Tagging + Resource Groups
จัดกลุ่ม resources — common tags: Name, Environment, Team, Project
Cost & Usage Reports
Dataset ของ billing ที่ละเอียดที่สุด — hourly/daily, ทุก services, ทุก IAM users, ทุก tags. Integrate กับ Athena, Redshift, QuickSight
Cost Explorer
Visualize ค่าใช้จ่ายตามเวลา, custom reports, granularity ระดับ monthly/hourly/resource, แนะนำ Savings Plan, forecast 12 เดือน
- Cost Allocation Tags: prefix
aws:= AWS-generated, prefixuser:= user-defined - ต้อง activate tags ใน Billing console ก่อนใช้ใน reports
- Cost & Usage Reports = comprehensive ที่สุด — analyze ผ่าน Athena/Redshift/QuickSight
- Cost Explorer = visualize + forecast 12 เดือนข้างหน้า + แนะนำ optimal Savings Plan
Monitoring Against Costs
Billing Alarms (CloudWatch)
อยู่ใน us-east-1 เท่านั้น — alert ตาม actual cost (ไม่ใช่ projected/forecast) — simple basic alert
AWS Budgets
Send alarms เมื่อ cost เกิน threshold — ละเอียดกว่า มี 3 types: Usage, Cost, Reservation
- Billing Alarms: ตั้งใน CloudWatch us-east-1 only, alert ตาม actual cost
- AWS Budgets: 3 types — Usage, Cost, Reservation
- Budget สำหรับ Reservation: track RI utilization (EC2, ElastiCache, RDS, Redshift)
- Budget รองรับสูงสุด 5 SNS notifications ต่อ budget
- Filter ได้ตาม service, account, tag, instance type, region
- ฟรี 2 budgets แรก แล้วคิด $0.02/วัน
AWS Trusted Advisor
AWS Trusted Advisor เป็น high-level account assessment — ไม่ต้อง install อะไร ทำงานอัตโนมัติ ตรวจสอบ best practices ของ account
Cost Optimization
หา resources ที่ idle / underutilized — เช่น EC2 instances ที่ไม่ได้ใช้
Performance
แนะนำการปรับปรุง performance — over-provisioned, CloudFront optimization
Security
ตรวจ security gaps — open security groups, MFA on root, public S3 buckets
Fault Tolerance
ตรวจ redundancy — RDS Multi-AZ, ELB cross-AZ, backups
Service Limits
เตือนเมื่อใกล้ถึง service quota — เช่น VPC limit, EC2 instance limit
- Core Checks (ทุก customer): MFA on root, security groups, S3 buckets, IAM key rotation ฯลฯ
- Full Trusted Advisor (Business + Enterprise plans): all checks + CloudWatch alarms + Programmatic Access
- 5 Categories: Cost Optimization, Performance, Security, Fault Tolerance, Service Limits
AWS Support Plans (5 Tiers)
AWS มี 5 Support Plans ตั้งแต่ Basic (ฟรี) จนถึง Enterprise — แตกต่างที่ response time, features และ access ถึง expert:
Basic (ฟรี)
24x7 customer service สำหรับ billing, documentation, 7 core Trusted Advisor checks, Personal Health Dashboard
Developer
Email business hours ถึง Cloud Support Associates, unlimited cases, 1 primary contact — SLA: General <24h, System impaired <12h
Business (24/7)
เหมาะกับ production — Full Trusted Advisor + API, 24x7 phone/email/chat ถึง Cloud Support Engineers, unlimited cases + contacts, Infrastructure Event Management (extra fee) — SLA: Production impaired <4h, Production down <1h
Enterprise On-Ramp
$5,500/เดือน — scaling enterprise needs, pool of TAMs, Concierge Support — SLA: Business-critical <30min
Enterprise (24/7)
Mission critical — Designated TAM, Concierge Support (billing/account), Infrastructure Event Management, Well-Architected Reviews — SLA: Business-critical down <15min
- Basic = ฟรี สำหรับทุก AWS customer — 7 core Trusted Advisor checks
- Developer: business hours email — Cloud Support Associates
- Business: 24/7 phone/email/chat — Cloud Support Engineers, Full Trusted Advisor
- Enterprise On-Ramp: $5,500/mo — pool of TAMs (ไม่ใช่ designated)
- Enterprise: designated TAM + Concierge + IEM + Well-Architected Reviews
- Concierge Support Team = expert ด้าน billing/account (ไม่ใช่ technical) — เฉพาะ Enterprise + Enterprise On-Ramp
Enterprise
15 นาที สำหรับ business-critical down — เร็วที่สุดในทุก plan
Enterprise On-Ramp
30 นาที สำหรับ business-critical down
Business
1 ชั่วโมง สำหรับ production system down
Developer / Basic
ไม่มี SLA สำหรับ business-critical / production down
Account Best Practices Summary
- Operate หลาย accounts ผ่าน AWS Organizations
- ใช้ SCPs เพื่อ restrict permission ที่ OU/account level
- ใช้ AWS Control Tower สำหรับ landing zone + guardrails
- ใช้ Tags + Cost Allocation Tags ตั้งแต่เริ่มต้น
- IAM: enable MFA, least privilege, password policy
- ใช้ AWS Config สำหรับ compliance monitoring
- ใช้ CloudFormation สำหรับ infrastructure as code
- ใช้ Trusted Advisor ตรวจสุขภาพ account
- เก็บ logs ไว้ใน S3 + CloudWatch Logs ที่ central account
- เปิด CloudTrail ทุก account
- วาง root recovery procedure สำหรับกรณีเข้า root account ไม่ได้
Billing Tools Summary
Compute Optimizer
แนะนำ resources ที่เหมาะสม (EC2, ASG, EBS, Lambda)
TCO Calculator
เปรียบเทียบ on-premises กับ AWS
Pricing Calculator
ประมาณค่าใช้จ่าย solution ที่จะ deploy
Billing Dashboard
ภาพรวมค่าใช้จ่ายและ free tier usage
Cost Allocation Tags
ติด tags เพื่อ track cost (aws: / user:)
Cost & Usage Reports
Dataset billing ละเอียดสุด — Athena/Redshift/QuickSight
Cost Explorer
Visualize + forecast + แนะนำ Savings Plan
Billing Alarms
CloudWatch alert ตาม actual cost (us-east-1 only)
AWS Budgets
Alert เมื่อ cost/usage/reservation เกิน threshold
Savings Plans
Commit $/hour 1-3 ปี ลดสูงสุด 72% (EC2) หรือ 66% (Compute)
- วางแผน: Pricing Calculator, TCO Calculator
- วิเคราะห์: Cost Explorer, Cost & Usage Reports, Compute Optimizer
- Alert: Billing Alarms, Budgets
- ประหยัด: Savings Plans, Reserved Instances