Write tests using Go's built-in package testing: you create a file ending in _test.go and run tests with the go test command. E.g., go test my_test.go . Use Terratest to execute your real IaC tools (e.g., Terraform, Packer, etc.) to deploy real infrastructure (e.g., servers) in a real environment (e.g., AWS).
Is Terratest open source?
Terratest - an Open Source Go Library for Automated Infrastructure Testing. Gruntwork has open sourced their Go framework Terratest which can be used to write automated tests for testing infrastructure. The library comes with support for Terraform and Packer.13 May 2018
How do you test a terraform code?
To run a test you need to provide a Terraform file and a Go test. Then you simply call go test and Terratest takes care of init ing and apply ing your infrastructure. It performs some tests then destroy s.
What is the point of Terratest?
Terratest is a Golang library that makes it easier to write automated tests for infrastructure code. A test run creates real infrastructure components (such as servers, firewalls or load balancers), deploys applications on them and validates the expected behavior using Terratest.24 Apr 2019
What is Terratest?
What is Terratest ? It's a Go library that helps you create and automate tests for your Infra as Code written with Terraform, Packer for IaaS providers like Amazon, Google or for a Kubernetes cluster.19 Mar 2019