Testing Your Code on Terraform: Terratest

Infrastructure as Code (IAC) is more than just a paradigm. Developers are now able to deploy the code they have written on a capable cloud infrastructure without having to configure the cloud environment and provision resources manually. With the help of frameworks like Terraform, deploying supporting cloud infrastructure is as easy as writing a few lines of code.

As with other code constructing the app, however, infrastructure code can have faults and may cause errors. The need for improved testing—including testing the resulting infrastructure itself—is growing rapidly. For the longest time, developers relied on manual testing for the ‘solution’—but that comes with its own set of inherent problems: it’s time-consuming, inefficient, and error prone. Terratest mitigates many of the issues in manual testing.