I wanted to share the best way to create a new Terraform module

From the readme:


  • Local testing with pre-commit-terraform.
    • Formats code with terraform fmt.
    • Validates code with terraform validate.
    • Automatic README updates with terraform-docs.
    • Static code analysis with TFLint, tfsec and checkov.
  • Devcontainer with dependencies pre-configured.
  • CI pipeline with Github Actions:
    • Reuses Devcontainer to run the same checks that run locally.
    • Runs tests against the latest Terraform version.
    • Runs tests against older versions of Terraform.
  • CD pipeline with Github Actions:
  • Testing with Terratest across all major versions of Terraform.
  • Shows use of module composition by combining smaller modules
  • Shows how to use “Higher-order modules” to extend module functionality.

Would love feedback and suggestions =)