Effective infrastructure testing is a core competency of engineers at New Context. Since we started migrating our clients infrastructure to Terraform, we have been researching and discussing a testing solution.
Due to the complexity of describing a large computing environment with code, we wanted the testing solution to be straightforward. As many New Context engineers have extensive experience with Chef, we were already familiar with Test Kitchen. Test Kitchen is an integration tool that allows for testing a range of platforms, management tools and test frameworks. Writing a Terraform testing tool based in Test Kitchen afforded us a readily extensible orchestration engine and a well-known workflow to ease adoption.
Using kitchen-terraform enables a test matrix that can vary in platforms, input variables and even fixture modules. kitchen-terraform provides a consistent approach for testing Terraform projects locally and in continuous integration pipelines.