STAGE 06 / LESSON 05
Terraform and infrastructure as code
Infrastructure as code describes infrastructure in files that can be reviewed and versioned.
THE IDEA
Understand it.
Terraform compares configuration with its recorded state and provider information to produce a plan. A plan helps a team review intended changes before applying them; it is not a substitute for understanding those changes.
State can contain sensitive values. Store and access it appropriately, coordinate concurrent changes, and review destructive operations carefully. Use a safe non-production account for practice.
SEE IT IN CONTEXT
Review before applying
terraform init
terraform plan
# Review the plan and obtain appropriate approval
# before any apply to real infrastructure.init prepares the working directory; plan previews proposed changes. Neither line means a production change is automatically approved.
LEARN FROM REAL WEBSITES
See it in the real world.
These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.
Shopify
Shopify engineering, 2022Manage infrastructure as code
Shopify described using Terraform to manage infrastructure across teams.
- Infrastructure configuration
- Terraform
- Managed infrastructure
What to learn: Versioned configuration helps teams review infrastructure changes and reproduce them consistently.
Read the source: Shopify Terraform at scaleCloudflare
Cloudflare engineering, 2025Automate configuration
Cloudflare describes using Terraform and automation to manage configuration at enterprise scale.
- Configuration as code
- Terraform provider
- Cloudflare configuration
What to learn: A provider connects declarative configuration to a platform's resources; review a plan before applying changes.
Read the source: Cloudflare infrastructure as codeTRY IT YOURSELF
Practice.
Why should a team review a Terraform plan before applying it?
Show one possible answer
A configuration change may create, replace or destroy resources. The plan makes the proposed effect reviewable before execution.
GO DEEPER