WIP
This repo is intended to try and demonstrate some of the capabilities of test tools built on top of terraform. We intend to try the following tools:
- static testing: tfsec
- dynamic testing: terratest This project comes with an automated github runner, as well as a manual section with command lines.
from project root folder, run:
go mod download
- remove profile from providers.tf
- set aws env variables to target your aws accounts
go test ./tests -v
additionally you can scope the tests with go test tags. Ex: go test ./tests tags=unit
(delete cache if tags separation is not working: go clean -modcache
)
terratest test_structure enables the sequencing of tests without provisioning and deprovisioning the infrastructure.
For that a main test function is defined, which:
- provision and destroys infra
- implements test_structure to define the sequences of tests to be performed.
skip a test with: SKIP_<stagename>=1 go test ./tests/ -v
EX: SKIP_test_versioning=1 go test ./tests/ -v