Terraform / CloudFormation
The infrastructure-as-code tools that define, provision, and version cloud resources through code rather than manual console clicks.
What it is
About Terraform / CloudFormation
Infrastructure as Code (IaC) is the practice of defining cloud infrastructure — servers, databases, networking, IAM roles, storage — in declarative configuration files that are version-controlled alongside application code. Terraform (by HashiCorp) is the dominant multi-cloud IaC tool: a Terraform configuration describes the desired state of infrastructure in HCL (HashiCorp Configuration Language), and `terraform plan` previews the changes needed to reach that state before `terraform apply` executes them. Terraform's provider model supports AWS, Azure, GCP, Kubernetes, and hundreds of other platforms in a single tool and workflow. The Terraform state file tracks what infrastructure currently exists, enabling safe incremental updates. AWS CloudFormation is Amazon's native IaC service: YAML or JSON templates describe AWS resources, and CloudFormation manages the provisioning and update lifecycle as "stacks." CloudFormation integrates tightly with AWS services — stack events, drift detection, and change sets are visible in the AWS console — and the AWS CDK (Cloud Development Kit) allows infrastructure to be defined in Python, TypeScript, or Java that compiles to CloudFormation. Systems Architects use these tools to codify approved infrastructure patterns, enforce consistency across environments, and make infrastructure changes reviewable through the same pull request process as application code.
What you can do with it
Capabilities
Write a Terraform module that provisions a VPC, subnets, an RDS database, and an ECS cluster with the correct IAM roles — then apply it to create identical environments in dev, staging, and production with different variable values
Run `terraform plan` before an infrastructure change, review the diff for unintended resource replacements, and use the output to brief the team on what will be destroyed and recreated
Use Terraform workspaces to manage per-environment state files and ensure a production `terraform apply` cannot accidentally modify staging infrastructure
Write a CloudFormation change set for a stack update, review the change set for resources that will be replaced, and present the impact to the operations team before approving the deployment
Refactor manually provisioned AWS resources into a Terraform configuration using `terraform import`, bring existing infrastructure under IaC control, and verify the first plan shows zero changes before committing
How to learn it
Learning Resources
HashiCorp's official Terraform tutorials at developer.hashicorp.com/terraform/tutorials — free, browser-based, and cover everything from first apply to multi-workspace deployments
HashiCorp Terraform Associate certification — the entry-level IaC credential; the study guide and practice exams are available free at developer.hashicorp.com
AWS CloudFormation User Guide at docs.aws.amazon.com/cloudformation — the authoritative reference; the "Getting Started" section walks through a first stack in an afternoon
"Terraform: Up & Running" by Yevgeniy Brikman (O'Reilly) — the most widely recommended Terraform book; covers state management, modules, and production patterns
Pro Tip
Store Terraform state in a remote backend (S3 + DynamoDB locking on AWS; Terraform Cloud otherwise) from day one. Local state files that live on a developer's laptop are the single biggest source of Terraform disasters — two people running `apply` against local state will diverge, and recovering from conflicting state is hours of forensic work.
Skills that use this tool
Roles that use this tool
Alternatives