Danh sách "sát thủ" credit cần tránh

Tier 1: Cực kỳ nguy hiểm (Có thể tiêu hết $200 trong vài giờ)

Amazon SageMaker

  • Training Jobs: $1-10/hour per instance
  • Notebook Instances: $0.0464-4.32/hour
  • Endpoints: $0.048-4.32/hour
  • ⚠️ Lưu ý: Dễ quên tắt, tự động scale

GPU Instances (EC2)

  • p3.2xlarge: $3.06/hour
  • p4d.24xlarge: $32.77/hour
  • g4dn.xlarge: $0.526/hour
  • ⚠️ Lưu ý: Rất đắt, không có Free Tier

Amazon Redshift

  • dc2.large: $0.25/hour
  • ra3.xlplus: $3.26/hour
  • ⚠️ Lưu ý: Minimum cluster size, khó optimize

🛡️ Chiến lược phòng thủ

🚨 1. Set up Billing Alerts

  • Truy cập Billing and cost management Set-up
  • Chọn tab Budgets
  • Nhấn Create Budgets Set-up
  • Chọn Customize
  • Chọn Cost budget
  • Nhấn Next Set-up
  • Nhập Budget name: My-200$-budget
  • Period: Monthly
  • Chọn Recurring budget
  • Budgeting method: Fixed
  • Budget amount: 200.00 Set-up
  • Chọn All AWS Services
  • Chọn Unblended costs
  • Nhấn Next Set-up
  • Nhấn Add alert threshold
  • Nhập và tạo lần lượt 4 alert: 12.5, 25, 50, 75
  • Nhập Email recipients cho từng alert Set-up Set-up Set-up Set-up
  • Kiểm tra các alert đã được tạo đầy đủ chưa Set-up
  • Nhấn Next Set-up
  • Review và nhấn Create Budget Set-up
  • Xin chúc mừng, vậy là bạn đã tạo Budget thành công để tiếp tục sử dụng AWS 1 cách “an toàn”

2. Daily Cost Monitoring

  • Check Cost Explorer hàng ngày
  • Review “Daily Spend”“Service Breakdown”
  • Set up Cost Anomaly Detection

3. Automated Cleanup Script

#!/bin/bash
# Script tự động cleanup (chạy hàng ngày)

# Stop all running EC2 instances tagged for shutdown
aws ec2 describe-instances --filters "Name=tag:AutoShutdown,Values=yes" \
  --query 'Reservations[].Instances[?State.Name==`running`].InstanceId' \
  --output text | xargs -r aws ec2 stop-instances --instance-ids

# Delete unattached EBS volumes older than 7 days
aws ec2 describe-volumes --filters "Name=status,Values=available" \
  --query 'Volumes[?CreateTime<=`2024-01-01`].VolumeId' \
  --output text | xargs -r aws ec2 delete-volume --volume-id

Safe Services cho Free Tier

Always Safe (có Free Tier generous)

  • Lambda: 1M requests/month free
  • DynamoDB: 25GB storage + 25 RCU/WCU free
  • S3: 5GB storage + 20,000 GET requests free
  • CloudWatch: 10 metrics + 1M API requests free
  • SNS: 1M publishes free
  • SES: 62,000 emails free

Safe với cẩn thận

  • EC2: t2.micro/t3.micro only
  • RDS: db.t3.micro only
  • ElastiCache: cache.t3.micro only
  • API Gateway: Monitor request count