When developing a Terraform module that will be used in multiple Terraform configurations and shared with other teams, there is one step that is often neglected and that is the testing of the module.
Among the Terraform framework and testing tools is the Terratest framework, created by the Gruntwork community (https://gruntwork.io/static/), which is popular and allows testing on code written in the Go language.
In this recipe, we will study how to use Terratest to write and run integration tests on Terraform configuration and modules in particular.
Getting ready
The Terratest test framework is written in Golang (Go language) and the tests run on the Go runtime. That's why, as a prerequisite, we need to install Go by going to https://golang.org/.
Here are some important steps to install Go: for...