AWS
Amazon Web Services — EC2 deployment, cloud infrastructure สำหรับ production services
What I Can Do
- Deploy และ manage services บน EC2
- ตั้งค่า networking (VPC, Security Groups, Load Balancer)
- ใช้ S3 สำหรับ object storage
- จัดการ RDS สำหรับ managed databases
- ตั้งค่า monitoring ด้วย CloudWatch
Commands I Use Daily
# configure credentials
aws configure
# list EC2 instances (with --query to filter ID, State, IP)
aws ec2 describe-instances
# SSH เข้า EC2
ssh -i my-key.pem ec2-user@<ip-address>
# copy files ไป S3
aws s3 cp local-file.txt s3://my-bucket/
# sync directory กับ S3
aws s3 sync ./dist s3://my-bucket/ --delete
# ดู CloudWatch logs
aws logs tail /aws/lambda/my-function --follow
# list S3 buckets
aws s3 lsEC2 (Elastic Compute Cloud)
EC2 = virtual servers บน AWS — เลือก instance type (t3.micro, m5.large ฯลฯ), AMI (Amazon Machine Image), region/AZ ใช้สำหรับ services ที่ต้องการ full control, persistent workloads
Security Groups
Security Groups = virtual firewall สำหรับ EC2 — ควบคุม inbound/outbound traffic ด้วย rules (protocol, port, source/destination) stateful — ถ้า allow inbound, response กลับได้อัตโนมัติ
VPC
- VPC — isolated network space
- Subnets — public (internet access) vs private (internal only)
- Internet Gateway — ให้ public subnets เข้า internet
- NAT Gateway — ให้ private subnets เข้า internet แบบ outbound only
- Route Tables — กำหนด traffic routing
S3 (Simple Storage Service)
Object storage — ไม่จำกัดขนาด, 99.999999999% durability, เลือก storage class ตาม access pattern ใช้สำหรับ static files, backups, data lake, static website hosting
RDS (Relational Database Service)
Managed database — PostgreSQL, MySQL, MariaDB, SQL Server, Oracle ไม่ต้อง manage OS, patches, backups เอง Multi-AZ deployment สำหรับ high availability, Read Replicas สำหรับ read scaling
IAM
- Users — individual accounts
- Roles — ใช้สำหรับ services (EC2, Lambda)
- Policies — JSON documents ที่ define permissions
- Groups — assign policies ให้กลุ่ม users
- Principle of least privilege — ให้ permissions น้อยที่สุดที่จำเป็น
Elastic Load Balancer
- ALB (Application Load Balancer) — Layer 7, HTTP/HTTPS, path-based routing
- NLB (Network Load Balancer) — Layer 4, TCP/UDP, ultra-low latency
- Distribute traffic ข้าม EC2 instances, health checks, SSL termination
CloudWatch
- Metrics — CPU, memory, network, custom metrics
- Alarms — trigger notifications เมื่อ metrics ข้าม threshold
- Logs — centralized log collection
- Dashboards — visual monitoring
Auto Scaling
Auto Scaling Groups ปรับจำนวน EC2 instances อัตโนมัติ — scale out เมื่อ load สูง, scale in เมื่อ load ต่ำ ใช้ร่วมกับ Load Balancer, กำหนด min/max/desired capacity
Route 53
DNS service — domain registration, DNS routing, health checks รองรับ routing policies: simple, weighted, latency-based, failover, geolocation
ECR (Elastic Container Registry)
Container registry สำหรับ Docker images — push images จาก CI/CD pipeline, pull เมื่อ deploy ไป ECS/EC2 integrated กับ IAM สำหรับ access control