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

Get Started (Setup)

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

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

  • Get Started (Setup) ကို ကြောက်စရာမလိုအောင် နားလည်မယ်
  • ကိုယ်တိုင် terraform command/HCL code ကို run ကြည့်တတ်မယ်
  • Real project ထဲမှာ ဒီ concept ကို ချက်ချင်း အသုံးချတတ်မယ်

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

Terraform ကို install ဖို free ဖြစ်ပါတယ် (HashiCorp ရဲ့ website ကနေ download ရယူနိုင်ပါတယ်)။ Cloud provider (AWS) တွေကို စမ်းချင်ရင် cloud account + credential setup လိုအပ်ပေမယ့်, learning အစပိုင်းအတွက် `local` provider (file system ပေါ်မှာ file တစ်ခု create ပေးတဲ့) ကို သုံးပြီး cost/account setup မလိုဘဲ Terraform workflow (init/plan/apply) ကို practice လုပ်လို့ရပါတယ်။

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

`.tf` file တစ်ခု ဖန်တီးပြီး `terraform init` (provider plugin ကို download) → `terraform plan` (ဘာတွေ ပြောင်းမလဲ preview ကြည့်) → `terraform apply` (တကယ် execute) ဆိုတဲ့ ၃ ဆင့် workflow ကို run ကြည့်ပါတယ် — ဒီ ၃ ဆင့်ဟာ tutorial တစ်လျှောက်လုံးမှာ ထပ်ခါထပ်ခါ တွေ့ရမှာပါ။

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

bash
# Check Terraform is installed
terraform version

# Initialize the working directory (downloads providers)
terraform init

# Preview what will be created/changed
terraform plan

# Actually create it
terraform apply
You should see
$ terraform version
Terraform v1.9.0
on windows_amd64

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

Terraform ကို install လုပ်ပြီး `terraform version` run ကြည့်ပါ — success output ရအောင် setup ပြီးအောင် လုပ်ပါ။

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

Cloud provider (AWS/Azure/GCP) ကို သုံးမယ့် lesson တွေမှာ တကယ့် cost ဖြစ်ပေါ်နိုင်ပါတယ် — free tier ကို သတိထားပြီး, `terraform destroy` နဲ့ resource ကို practice ပြီးတိုင်း ရှင်းလင်းပေးဖို့ မမေ့ပါနှင့်။

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

  • `terraform init` ကို folder အသစ်တစ်ခု (provider block ပြောင်းလဲထားတဲ့) ထဲမှာ run ဖို့ မေ့ခြင်း — provider ပြောင်းတိုင်း init ပြန်လုပ်ရပါမယ်
  • `terraform apply` ကို `plan` ကို အရင်မကြည့်ဘဲ လိုက်run ခြင်း — production မှာ plan ကို သေချာဖတ်ပြီးမှ apply လုပ်ကြသင့်ပါတယ်

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

Terraform ကို install လုပ်ပြီး `terraform version` run ကြည့်ပါ — success output ရအောင် setup ပြီးအောင် လုပ်ပါ။

You'll know it worked when: $ terraform version Terraform v1.9.0 on windows_amd64