ခဏလေး ဒီလိုပဲ စဉ်းစားကြည့်
အရင်တုန်းက server တစ်လုံး setup လုပ်ချင်ရင် cloud console (AWS/Azure/GCP website) ကို click ချ, click ချ လုပ်ရပါတယ် — server ၅၀ လုံး setup လုပ်ရမယ်ဆိုရင်ကော? Manual click တွေ ထပ်ခါထပ်ခါ လုပ်ရင် error လွယ်ပြီး, ဘယ်သူတစ်ယောက်စီက ဘာ setting လဲ ချထားလိုက်တာလဲ မှတ်မိဖို့ ခက်ပါတယ်။ Terraform က infrastructure ရဲ့ desired state ကို HCL (HashiCorp Configuration Language) ဆိုတဲ့ readable syntax နဲ့ code file ထဲမှာ ရေးထားပြီး, `terraform apply` command တစ်ကြောင်းတည်းနဲ့ cloud provider ဆီ create/update instruction ကို အလိုအလျောက် ပို့ပေးပါတယ် — code ကို git repository ထဲ commit ထားလို့ရလို့ history/review/rollback အားလုံး software development လိုမျိုး လုပ်လို့ရပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Restaurant chain ကို ထပ်ဥပမာပေးရရင် — manual approach က branch တစ်ခုချင်းစီကို architect ဆီသွားပြီး 'ဒီလိုပုံစံ ဆောက်ပါ' လို့ ခန့်လှမ်းပြောနေရသလိုမျိုးပါ, IaC approach ကတော့ blueprint (design document) တစ်ခု ရေးထားပြီး, ဘယ် branch မဆို အဲဒီ blueprint ကို ကူးပြီး ချက်ချင်း တည်ဆောက်လို့ရအောင် ပြောင်းလိုက်တာနဲ့ တူပါတယ်။ Terraform ကို AWS, Azure, GCP, Kubernetes, Cloudflare, GitHub စတဲ့ provider ၃၀၀၀ ကျော်နဲ့ တွဲသုံးနိုင်ပါတယ် — cloud provider ချင်း တစ်ခုတည်းသာ ကန့်သတ်မထားပါ။
အတူတူ ကြည့်မယ်
Without Terraform:
Click through the AWS console 50 times to create 50 servers,
hope everyone on the team clicked the same settings.
With Terraform:
Write the desired infrastructure once, as code.
Run `terraform apply` — Terraform makes reality match the code,
every time, for anyone on the team.Terraform ကို 'infrastructure ဘာသာစကား ဖြင့် ရေးသားခြင်း' အနေနဲ့ ရှင်းပြနိုင်မည်။၅ မိနစ် စမ်းကြည့်
Server ၂၀ လုံးကို manual click ဖြင့် setup လုပ်ရမယ့် scenario ကို (၁) manual approach (၂) Terraform approach ၂ မျိုးနဲ့ ဘယ်လို ကွာခြားမလဲ ၃ ကြောင်း ရေးကြည့်ပါ။
သတိလေးတစ်ချက်
Terraform ကို production infra အတွက် စတင်သုံးမယ်ဆိုရင် cloud provider (AWS/Azure/GCP) အကောင့်ဖွင့်ပြီးမှသာ တကယ့် resource တွေ create နိုင်ပါမယ် — ဒီ tutorial ရဲ့ hands-on lesson အများစုက cost မလိုအပ်တဲ့ local/free provider ကိုသာ သုံးထားပါတယ်။