ফ্রি প্রিভিউ · শুরুর স্তর · 15 মিনিটের পাঠ
Terraform IaC Mental Model & Core Workflow
Understand declarative infrastructure, desired state, providers, dependency graphs, state, and the write → init → plan → apply feedback loop.
বাংলা অনুবাদ এখনো নেই, ইংরেজি দেখানো হচ্ছে।
Terraform is an Infrastructure as Code (IaC) tool. Instead of clicking through cloud consoles, you describe desired infrastructure in configuration and let Terraform calculate the actions required to move real infrastructure toward that desired state.
The four pieces to keep in your head
Configuration (.tf)
|
| describes desired infrastructure
v
Terraform Core -----> Providers -----> Cloud / SaaS / APIs
|
| reads/writes
v
State
- Configuration describes what you want.
- Terraform Core evaluates configuration, expressions and dependencies.
- Providers are plugins that translate Terraform operations into API calls.
- State maps Terraform resource addresses to real remote objects and stores metadata Terraform needs for future plans.
Declarative, not procedural
You normally say:
resource "aws_s3_bucket" "logs" {
bucket = "example-company-logs"
}
You do not write a procedure such as "call the create bucket API, wait five seconds, then save the ID." Terraform and the provider determine the necessary operations.
The core workflow
WRITE
↓
terraform init
↓
terraform fmt / validate
↓
terraform plan
↓
REVIEW
↓
terraform apply
↓
VERIFY
↓
CHANGE CONFIGURATION AND REPEAT
terraform init
Prepares the working directory. It initializes the backend and installs required providers/modules.
terraform plan
Builds an execution plan by comparing configuration, state, and refreshed remote information. Treat the plan as your change preview.
terraform apply
Executes approved changes and updates state after successful operations.
Resource graph mental model
References create dependencies:
resource "aws_subnet" "app" {
vpc_id = aws_vpc.main.id
}
Terraform can infer that the VPC must exist before the subnet because the subnet references aws_vpc.main.id.