Terraform
Terraform is an infrastructure provisioning tool that uses declarative configuration to create, update, and destroy resources across many providers.
Why Terraform
- It is declarative rather than procedural.
- It works with many providers from a single workflow.
- It keeps infrastructure changes reviewable in version control.
- It manages lifecycle and state explicitly.
Core Pages
Workflow
- Scope the infrastructure you need.
- Write the configuration in
.tffiles. - Run
terraform initto download providers. - Run
terraform planto review changes. - Run
terraform applyto create or update resources. - Use
terraform destroywhen the infrastructure is no longer needed.
Practical Notes
- Keep state protected and backed up.
- Prefer modules when the same pattern repeats.
- Use variables, outputs, and data sources to keep configurations reusable.