Categorygithub.com/fanovilla/terraform-unit-testing

# Packages

No description provided by the author
No description provided by the author

# README

Terraform Unit Testing with Go and JMESPath

FAQs

Why Go?

  • Just nice symmetry with Terraform written in go

Why JMESPath?

Why not jq?

  • See Why JMESPath above
  • However, you can use jq to processPlanFixture.Json which is exposed as a string

Directory Layouts

Simple case, main.tf in project root.

project_root
  main.tf
  tests
    suite
      sample_test.go

Multiple root modules, main.tf one folder down from project root

project_root
  s3_module
    main.tf
    tests
      suite
        sample_test.go
  ec2_module
    main.tf
    tests
      suite
        sample_test.go

Multiple root modules using common submodule, main.tf one folder down from project root

project_root
  modules
    common_module
      main.tf
  s3_module
    main.tf
    tests
      suite
        sample_test.go
  ec2_module
    main.tf
    tests
      suite
        sample_test.go