|
| 1 | +plugin "aws" { |
| 2 | + enabled = true |
| 3 | + version = "0.14.0" |
| 4 | + source = "github.com/terraform-linters/tflint-ruleset-aws" |
| 5 | +} |
| 6 | + |
| 7 | +config { |
| 8 | +#Enables module inspection |
| 9 | +module = false |
| 10 | +force = false |
| 11 | +} |
| 12 | + |
| 13 | +# Required that all AWS resources have specified tags. |
| 14 | +rule "aws_resource_missing_tags" { |
| 15 | + enabled = true |
| 16 | + tags = [ |
| 17 | + "Name", |
| 18 | + "Environment", |
| 19 | + ] |
| 20 | +} |
| 21 | + |
| 22 | +# Disallow deprecated (0.11-style) interpolation |
| 23 | +rule "terraform_deprecated_interpolation" { |
| 24 | +enabled = true |
| 25 | +} |
| 26 | + |
| 27 | +# Disallow legacy dot index syntax. |
| 28 | +rule "terraform_deprecated_index" { |
| 29 | +enabled = true |
| 30 | +} |
| 31 | + |
| 32 | +# Disallow variables, data sources, and locals that are declared but never used. |
| 33 | +rule "terraform_unused_declarations" { |
| 34 | +enabled = true |
| 35 | +} |
| 36 | + |
| 37 | +# Disallow // comments in favor of #. |
| 38 | +rule "terraform_comment_syntax" { |
| 39 | +enabled = false |
| 40 | +} |
| 41 | + |
| 42 | +# Disallow output declarations without description. |
| 43 | +rule "terraform_documented_outputs" { |
| 44 | +enabled = true |
| 45 | +} |
| 46 | + |
| 47 | +# Disallow variable declarations without description. |
| 48 | +rule "terraform_documented_variables" { |
| 49 | +enabled = true |
| 50 | +} |
| 51 | + |
| 52 | +# Disallow variable declarations without type. |
| 53 | +rule "terraform_typed_variables" { |
| 54 | +enabled = true |
| 55 | +} |
| 56 | + |
| 57 | +# Disallow specifying a git or mercurial repository as a module source without pinning to a version. |
| 58 | +rule "terraform_module_pinned_source" { |
| 59 | +enabled = true |
| 60 | +} |
| 61 | + |
| 62 | +# Enforces naming conventions |
| 63 | +rule "terraform_naming_convention" { |
| 64 | +enabled = true |
| 65 | + |
| 66 | +#Require specific naming structure |
| 67 | +variable { |
| 68 | +format = "snake_case" |
| 69 | +} |
| 70 | + |
| 71 | +locals { |
| 72 | +format = "snake_case" |
| 73 | +} |
| 74 | + |
| 75 | +output { |
| 76 | +format = "snake_case" |
| 77 | +} |
| 78 | + |
| 79 | +#Allow any format |
| 80 | +resource { |
| 81 | +format = "none" |
| 82 | +} |
| 83 | + |
| 84 | +module { |
| 85 | +format = "none" |
| 86 | +} |
| 87 | + |
| 88 | +data { |
| 89 | +format = "none" |
| 90 | +} |
| 91 | + |
| 92 | +} |
| 93 | + |
| 94 | +# Disallow terraform declarations without require_version. |
| 95 | +rule "terraform_required_version" { |
| 96 | +enabled = true |
| 97 | +} |
| 98 | + |
| 99 | +# Require that all providers have version constraints through required_providers. |
| 100 | +rule "terraform_required_providers" { |
| 101 | +enabled = true |
| 102 | +} |
| 103 | + |
| 104 | +# Ensure that a module complies with the Terraform Standard Module Structure |
| 105 | +rule "terraform_standard_module_structure" { |
| 106 | +enabled = true |
| 107 | +} |
| 108 | + |
| 109 | +# terraform.workspace should not be used with a "remote" backend with remote execution. |
| 110 | +rule "terraform_workspace_remote" { |
| 111 | +enabled = true |
| 112 | +} |
0 commit comments