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

ကျွန်တော်ဒီနေ့ 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 ထိသွားပါ။

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704012300890/49b7c564-efb0-493f-80ed-e6c18b5d1ad8.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704012491806/10ac58d7-ee8d-48dd-8fab-199745399c12.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704012627978/2f2f5782-5945-4f7f-b90f-a50d092115a5.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704012853129/e1d8396b-bb05-411d-9d77-1d929dc6d0ef.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704013046818/5ff70d3c-001f-43fd-843b-c1ec36bc4bcb.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704013154952/e553e177-ec34-4727-8066-1b1b6e5cf001.png align="center")

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

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1704013173620/cb699044-a6f4-437b-bf8a-ba982b7cbc30.png align="center")

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