Skip to main content

Command Palette

Search for a command to run...

AWS ရဲ့Termination protection ကို သုံးသင့်လား၊ မသုံးသင့်ဘူးလား?

Published
2 min read
AWS ရဲ့Termination protection ကို သုံးသင့်လား၊ မသုံးသင့်ဘူးလား?
Z

I'm Zin Lin Htet. Who love to learn and share about Linux, Cloud, Docker and K8s. Currently working as a DevOps Engineer at one of the famous Fintech Company in Myanmar.

ကျွန်တော်ဒီနေ့ Sharing လုပ်ပေးချင်တဲ့ အကြောင်းအရာကတော့ AWS ရဲ့ termination protection ကိုသုံးသင့်လား မသုံးသင့်ဘူးလားဆိုတာ ကိုပြောပြချင်ပါတယ်။ ကျွန်တော်တို့ တွေဟာ AWS Cloud ပေါ်မှာ ကို့လုပ်ငန်းအတွက်လိုအပ်တဲ့ resources တွေ ကို create လုပ်ပီး သုံးကျပါတယ်။ အဲ့လို လုပ်ပီးသုံးကျတဲ့ အပိုင်းမှာ အသုံးမလိုတဲ့ resources တွေကို ဖျက်ကျတယ်ပေါ့နော်၊ မသုံးပဲနဲ့ charges မလုပ်နေအောင်ဆိုတဲ့ သဘောမျိုးနဲ့ပေါ့။ အဲ့အထိက အဆင်ပြေနေပါသေးတယ်။

ဆရာကြီးတို့ အနေနဲ့ တကယ် အသုံးမလိုလို့ ဖျက်လိုက်ရတာက အကြောင်းမဟုတ်ပေမဲ့ Production Environment မျိုး ၊ UAT Environment မျိုးက Instance တွေ RDS တွေ ကိုမှားဖျက်မိလိုက်မယ် ဆိုရင် ကို့ဘဝ ကိုတွေးပါပဲ။ အဲ့တာမျိုး မမှားရအောင် Accidentally terminated မဖြစ်ရအောင် ကိုသုံးနေတဲ့ EC2 Instances တွေ RDS တွေမှာ Termination protection function ကို Enable လုပ်ထားသင့်ပါတယ်။ သူက Default ဆိုရင် Disable လုပ်ထားတာမလို့ပါ။

အဲ့တော့ ကျွန်တော်တို့ Termination protection ကို on လိုက်ပီဆိုတာ နဲ့ EC2 တွေ RDS တွေ ကို ဘယ်လောက်ဖျက်ဖျက် မပျက်တော့ပါဘူး။ ဒါပေမဲ့ မေးစရာ တစ်ခုပေါ်လာတာက အကယ်လို့ Termination protection on ထားတဲ့ Instance or RDS တစ်လုံးကို အသုံးမလိုလို့ ဖျက်မယ်ဆိုရင်ကော ဖျက်လို့ ရလားပေါ့ ရပါတယ် ဖျက်လို့ ။ တစ်ခုပဲလုပ်ပေးရပါမယ် အဲ့ Instance or RDS မှာ on ထားတဲ့ Termination protection ကို disable ပြန်လုပ်လိုက်ပီး termination လုပ်ရင် ပျက်သွားပါလိမ့်မယ်။ ဆိုတော့ ထုံစံအတိုင်း demo နဲ့ တွဲပြပါမယ်။

အရင်ဆုံး ကျွန်တော်တို့ Termination protection on မဲ့ Instance ဆီသွားပါ။ Action အောက်က Instance settings အောက်က Change termination protection ထိသွားပါ။

ဒီလို Box လေးတက်လာပါမယ်၊ အဲ့မှာသူက Default ဆိုရင် Enable မလုပ်ထားပါဘူး။ အဲ့ Check box လေးကို On ပေးလိုက်ပါ။ ပီးရင် Save လိုက်ပါ။

အဲ့ Instance ကို Terminate လုပ်ကြည့်ပါ။ သတိထားကြည့်ကြည့်ပါ Termination protection က Enabled ဖြစ်နေပါလိမ့်မယ်။ အဲ့တာဆို ဖျက်ကြည့်ရင် တောင် မပျက်တော့ပါဘူး။

Failed to terminate an instance ဆိုပီး ပေါ်လာပါလိမ့်မယ်။ ဒီဟာက EC2 Instance မှာလုပ်တဲ့နည်းပါ။

RDS တွေဆိုလည်း အဲ့နည်းအတိုင်းပါပဲ။ Default ဆိုရင် Enable မလုပ်ထားပါဘူး။ သက်ဆိုင်ရာ RDS ဆီသွားပီး Modify setting ကိုနှိပ်ပီး Enable သွားလုပ်ပေးရပါမယ်။

အဲ့နေရာမှာ Apply immediately ဆိုတာကိုရွေးပေးပါ။ RDS မှာ ပြောင်းလိုက်တဲ့ Setting ကို ချက်ချင်း Effect ဖြစ်စေချင်လို့ပါ။ ပီးရင် Modify DB Instance ဆိုတာကို နှိပ်ပါ။

ကျွန်တော့ တစ်ကိုယ်ရည် အမြင်ရကြည့်မယ်ဆိုရင် Production လိုမျိုး UAT လိုမျိုး မှာ ရှိတဲ့ Instance တွေ RDS တွေကို Termination protection ကို On ထားသင့်ပါတယ်။ Human error ဆိုတာပြောလို့မရပါဘူး မှားပီး မေ့ပီး ဖျက်မိတာမျိုးဖြစ်လာနိုင်ပါတယ်။ ကိုပိုင် Lab စမ်းတာမျိုး၊ မှားဖျက်လည်း ဘာမှ မဖြစ်တဲ့ အနေအထားဆိုရင်တော့ Protection မ on ထားလည်းပြသနာ မရှိပါဘူး။ ဒီနေ့ကတော့ ဒီနားမှာပဲ ရပ်ထားပါရစေ ။ ဒီ Article လေးကနေ တစ်ခုခု ရသွားမယ်လို့လည်း မျှော်လင့်မိပါတယ်။

More from this blog

Technical 101

69 posts

"Mingalarbar , I am an IT guy from Myanmar who enjoys learning and sharing about Linux, Cloud, Docker & K8s. I am planning to share my expertise with the information technology communities in Burma