Testing in Infrastructure as Code
summary
Argues that Terraform-based tests (using terratest) are integration-only, slow and flaky — single runs take ~50–90 seconds, require real cloud access and Go, so they fail under name collisions. Describes a Spock/Groovy mini framework that runs Terraform or aws cdk, supports localstack, and still runs integrations but lets CDK enable fast unit tests (≈100 ms) to validate naming logic. Predicts future IaC moves toward CDK/Pulumi-style general-purpose languages despite needing external binaries for some workflows.
AI-written summary · about
chapters (17)
- 0:00Intro
- 1:32Introduction
- 1:49Writing tests
- 2:01About me
- 3:00Presentation
- 3:41Why automated tests
- 4:49Test pyramid
- 6:46Example problem
- 7:45Module implementation
- 8:20Terraform module
- 10:20TeraTest
- 13:23Golang
- 14:35Mini Framework
- 15:27Integration Test
- 21:06CDK vs SDK
- 29:14CDK vs Terraform
- 30:46Other infrastructure code tools
related talks
52mTest Driven Delivery of Infrastructure-As-Code
37mInfraCoding with Terraform: Writing Tests for Infrastructure-as-Code
47mInfrastructure Testing explained
17mTDD for Infrastructure Code
36mBuild infrastructure as a code (IaC) using test-later...
41mScaling Infrastructure as Code
29mEphemeral Cloud Infrastructure for Acceptance Tests with Terraform Enterprise & GitLab
10m“Test Fast. Test Local. Test AWS.”
