github.com/terraform-modules-krish/terratest@v0.29.0/examples/terraform-basic-example/README.md (about) 1 # Terraform Basic Example 2 3 This folder contains a very simple Terraform module to demonstrate how you can use Terratest to write automated tests 4 for your Terraform code. This module takes in an input variable called `example`, renders it using a `template_file` 5 data source, and outputs the result in an output variable called `example`. 6 7 Check out [test/terraform_basic_example_test.go](https://github.com/terraform-modules-krish/terratest/blob/v0.29.0/test/terraform_basic_example_test.go) to see how you can write 8 automated tests for this simple module. 9 10 Note that this module doesn't do anything useful; it's just here to demonstrate the simplest usage pattern for 11 Terratest. For a slightly more complicated, real-world example of a Terraform module and the corresponding tests, see 12 [terraform-aws-example](https://github.com/terraform-modules-krish/terratest/blob/v0.29.0/examples/terraform-aws-example). 13 14 15 16 17 ## Running this module manually 18 19 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`. 20 1. Run `terraform init`. 21 1. Run `terraform apply`. 22 1. When you're done, run `terraform destroy`. 23 24 25 26 27 ## Running automated tests against this module 28 29 1. Install [Terraform](https://www.terraform.io/) and make sure it's on your `PATH`. 30 1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`. 31 1. `cd test` 32 1. `dep ensure` 33 1. `go test -v -run TestTerraformBasicExample`