Thuta Learning
ရှာဖွေရန်
AdvancedDevOpsbeginner

Cost Management & Billing

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Cost Management & Billing ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် AWS CLI/Console ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်

AWS pay-as-you-go pricing က flexible ပေမယ့်, monitor မလုပ်ရင် unexpected bill ကို ရင်ဆိုင်ရနိုင်ပါတယ် — Billing Alert (CloudWatch Alarm ကို billing metric နဲ့ တွဲသုံးခြင်း) ကို account create ချိန် ကတည်းက setup လုပ်သင့်ပါတယ် (threshold ကျော်ရင် email ပို့ပေးပါတယ်)။ AWS Budgets ကတော့ monthly/custom period spending limit ကို ချထားနိုင်ပါတယ် — limit ကျော်ခါနီးရင် (ဥပမာ - 80% ရောက်ရင်) notification ပို့ပေးပါတယ်။ Cost Explorer ကတော့ ဘယ် service ကနေ ဘယ်လောက် cost ဖြစ်နေလဲ (breakdown by service/region/tag) ကို visualize ကြည့်နိုင်တဲ့ dashboard ပါ.

လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်

Monthly Budget ကို $10 ချထားပြီး, 80% ($8) ရောက်ရင် email ပို့ပေးအောင် setup လုပ်ထားရင် — practice လုပ်နေရင်း EC2/RDS instance တစ်ခု forget ပြီး run နေခဲ့ရင် ရုတ်တရက် $50 bill ဖြစ်လာမည့်အစား, $8 ရောက်တာနဲ့ email notification ရလို့ ကြိုတင်တွေ့နိုင်ပါတယ်။ Cost Explorer ထဲမှာ EC2 ကနေ cost အများဆုံး ဖြစ်နေတယ်ဆိုရင်, instance type ကို right-size လုပ်ဖို့ (ဒါမှမဟုတ် unused instance ရှာဖျက်ဖို့) plan ချနိုင်ပါတယ်.

အတူတူ ကြည့်မယ်

bash
# Create a monthly budget with an alert at 80% usage
aws budgets create-budget \
  --account-id 123456789012 \
  --budget '{
    "BudgetName": "tutorial-monthly-budget",
    "BudgetLimit": {"Amount": "10", "Unit": "USD"},
    "TimeUnit": "MONTHLY",
    "BudgetType": "COST"
  }' \
  --notifications-with-subscribers '[{
    "Notification": {"NotificationType": "ACTUAL", "ComparisonOperator": "GREATER_THAN", "Threshold": 80},
    "Subscribers": [{"SubscriptionType": "EMAIL", "Address": "you@example.com"}]
  }]'
You should see
$ (email) Subject: AWS Budgets: tutorial-monthly-budget has exceeded 80% of your budgeted amount

၅ မိနစ် စမ်းကြည့်

AWS Console ထဲမှာ $5-$10 monthly Budget တစ်ခု (80% threshold email alert ပါ) setup လုပ်ကြည့်ပါ — Cost Explorer ကို ဖွင့်ပြီး ယခုအထိ ဘယ် service ကနေ cost ဖြစ်နေလဲ ကြည့်ကြည့်ပါ။

သတိလေးတစ်ချက်

Billing Alert/Budget ကို account create ချိန် ကတည်းက ချက်ချင်း setup လုပ်ပါ — 'နောက်မှ setup လုပ်မယ်' ဆိုတဲ့ delay ကြောင့် unexpected bill ကို ကြုံရတတ်တဲ့ scenario က အသစ်စ AWS user တွေမှာ အဖြစ်များဆုံး mistake တစ်ခုပါ။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • Billing Alert/Budget ကို setup မလုပ်ဘဲ practice ဆက်လုပ်ခြင်း — resource တစ်ခု forget ပြီး run နေခဲ့ရင် bill ကို ကြာမှ တွေ့နိုင်ပါတယ်
  • Budget ကို ချထားထားပေမယ့် email notification ကို subscribe မလုပ်ခြင်း — alert ရောက်ပေမယ့် ဘယ်သူမှ မမြင်တော့ပါ

အခု ကိုယ်တိုင် စမ်းကြည့်

AWS Console ထဲမှာ $5-$10 monthly Budget တစ်ခု (80% threshold email alert ပါ) setup လုပ်ကြည့်ပါ — Cost Explorer ကို ဖွင့်ပြီး ယခုအထိ ဘယ် service ကနေ cost ဖြစ်နေလဲ ကြည့်ကြည့်ပါ။

You'll know it worked when: $ (email) Subject: AWS Budgets: tutorial-monthly-budget has exceeded 80% of your budgeted amount

Cost Management & Billing | Thuta Learning