Integration and Unit Testing on HashiCorp Terraform and Nomad
summary
Explains a practical workflow for unit and integration testing Terraform and Nomad using Terratest and Kitchen to exercise the Nomad API, shows solitary vs sociable unit tests and small-module integration tests, and demonstrates a Go helper that converts Terraform plan JSON into a flat map — the terraform-test library — so tests query keys instead of complex JSON paths. Tests run against plan JSON (no full apply), assertions are automatic, and the demo code works and is open source but still finishing structural comparisons.
AI-written summary · about
chapters (14)
- 0:00Intro
- 0:36laC with no tests is broken
- 2:35Workload orchestration made easy
- 3:02Myths and Truths Myth
- 6:40Defining a unit
- 7:05Solitary tests
- 8:20Nomad job terraform resource
- 9:39Sociable tests
- 11:18Nomad namespace cont....
- 11:54Defining an integration
- 12:22Nomad enterprise terraform module
- 15:05Terratest - apply_example_test.go
- 17:41Terratest-plan_example_test.go
- 20:55Terraformtest - plan_example_test.go
related talks
52mTest Driven Delivery of Infrastructure-As-Code
35mTesting in Infrastructure as Code
17mTDD for Infrastructure Code
37mInfraCoding with Terraform: Writing Tests for Infrastructure-as-Code
36mBuild infrastructure as a code (IaC) using test-later...
47mInfrastructure Testing explained
29mShifting Security and Sanity Left by Testing Terraform with InSpec
18mImplementing Unit Tests for Terraform with Open Policy Agent
