Running ’terraform plan’ is not enough to guarantee your infrastructure works. In this final episode, we bridge the gap between DevOps and Software Engineering by writing automated Golang tests using Terratest. We will programmatically provision infrastructure, assert its correctness, and tear it down.
As your Terraform codebase scales across dozens of microservices and environments, you will find yourself copy-pasting the same ‘backend’ and ‘provider’ blocks repeatedly. Terragrunt is a powerful wrapper that eliminates this repetition, allowing you to define global configurations once.
Refactoring HCL code is dangerous. If you rename a resource block, Terraform will attempt to destroy the old resource and recreate it. In this episode, we learn how to use ‘moved’ blocks and the state CLI to refactor code safely, preventing catastrophic database deletions.
Running ’terraform apply’ from a local laptop is a major security and compliance risk. In this episode, we transition to a GitOps workflow. You will learn how to automate Terraform plans on Pull Requests, and automatically apply changes upon merging to the main branch using GitHub Actions.
Welcome to Tier 3: Advanced Platform Engineering. You now know how to write reusable modules and store state remotely. But how do you safely deploy identical infrastructure to both Staging and Production without them colliding? We explore Workspaces and Directory Isolation.
Local state files are fine for solo learning, but catastrophic for team environments. In this episode, we will solve the ‘state file drift’ problem by configuring a Remote Backend on AWS S3, and preventing simultaneous executions using DynamoDB locking.
Modules are the functions of the Terraform ecosystem. In this episode, we will build a reusable AWS VPC module from scratch, define explicit inputs and outputs, and consume it from a separate Root Module. Stop copy-pasting code and start building a self-service infrastructure catalog.
While ‘count’ and ‘for_each’ duplicate entire resources, ‘dynamic’ blocks duplicate nested configurations inside a single resource. Discover how to build highly flexible, list-driven Security Groups and Route Tables without repeating HCL blocks.
Copy-pasting resource blocks is a cardinal sin in Platform Engineering. In this episode, we will deploy identical infrastructure fleets using loops. You will learn the critical differences between ‘count’ and ‘for_each’, and why ‘count’ can accidentally destroy your production servers if used incorrectly.
Terraform is not just static configuration; it is a powerful programming language. In this episode, we explore how to perform string interpolations, use mathematical functions, and centralize complex expressions using the ’locals’ block to keep your code DRY.