Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 972 Bytes

terraform_standard_module_structure.md

File metadata and controls

31 lines (20 loc) · 972 Bytes

terraform_standard_module_structure

Ensure that a module complies with the Terraform Standard Module Structure

Example

main.tf

variable "v" {}
$ tflint
1 issue(s) found:

Warning: variable "v" should be moved from main.tf to variables.tf (terraform_standard_module_structure)

  on main.tf line 1:
   1: variable "v" {}

Reference: https://github.com/terraform-linters/tflint/blob/v0.16.0/docs/rules/terraform_standard_module_structure.md

Why

Terraform's documentation outlines a Standard Module Structure. A minimal module should have a main.tf, variables.tf, and outputs.tf file. Variable and output blocks should be included in the corresponding file.

How To Fix

  • Move blocks to their conventional files as needed
  • Create empty files even if no variable or output blocks are defined