Shifting Security and Sanity Left by Testing Terraform with InSpec
summary
Demonstrates a concrete workflow: use Test Kitchen with the kitchen-terraform driver to spin up isolated Terraform sandboxes (Ruby + bundler required), run Terraform apply, then execute InSpec profiles against two targets — the provisioned VM and the Azure subscription — and tear down with kitchen destroy. Recommends running InSpec as a local-exec only for production validation and compliance, and using kitchen verify for test-driven development and CI gating. Demo builds resources, runs tests, and destroys the sandbox successfully.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:30Why test Terraform early
- 3:55What is InSpec?
- 7:48Validating production deployments
- 11:44Test-driven development with Test Kitchen
- 15:46Setting up Test Kitchen
- 20:20Running Test Kitchen tests
- 25:39Cleaning up test environments
- 26:46Use cases recap
- 27:51Final thoughts and resources
related talks
36mIntroduction to Test-kitchen and InSpec
28mSeems Legit: Testing Cloud Provisioning with InSpec
52mTest Driven Delivery of Infrastructure-As-Code
47mTest Driven Infrastructure with Serverspec & Kitchen CI
37mInfraCoding with Terraform: Writing Tests for Infrastructure-as-Code
22mMoving Fast Together: Test-Driven Infrastructure
47mInfrastructure Testing explained
45mAudit and Assess the Security of Your Infrastructure
