Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All rules are enabled by default, but by setting `preset = "recommended"`, you c
|[terraform_comment_syntax](terraform_comment_syntax.md)|Disallow `//` comments in favor of `#`||
|[terraform_deprecated_index](terraform_deprecated_index.md)|Disallow legacy dot index syntax|✔|
|[terraform_deprecated_interpolation](terraform_deprecated_interpolation.md)|Disallow deprecated (0.11-style) interpolation|✔|
|[terraform_deprecated_lookup](terraform_deprecated_lookup.md)|Disallow deprecated `lookup()` function with only 2 arguments.||
|[terraform_deprecated_lookup](terraform_deprecated_lookup.md)|Disallow deprecated `lookup()` function with only 2 arguments.||
|[terraform_documented_outputs](terraform_documented_outputs.md)|Disallow `output` declarations without description||
|[terraform_documented_variables](terraform_documented_variables.md)|Disallow `variable` declarations without description||
|[terraform_empty_list_equality](terraform_empty_list_equality.md)|Disallow comparisons with `[]` when checking if a collection is empty|✔|
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/terraform_deprecated_lookup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Disallow deprecated [`lookup` function](https://developer.hashicorp.com/terraform/language/functions/lookup) usage without a default.

> This rule is enabled by "recommended" preset.

## Example

```hcl
Expand All @@ -25,7 +27,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0

## Why

Calling [`lookup`](https://developer.hashicorp.com/terraform/language/functions/lookup) with 2 arguments has been deprecated since Terraform v0.7. `lookup(map, key)` is equivalent to the native index syntax `map[key]`. `lookup` should only be used with the third `default` argument, even though it is optional for backward compatiblity.
Calling [`lookup`](https://developer.hashicorp.com/terraform/language/functions/lookup) with 2 arguments has been deprecated since Terraform v0.7. `lookup(map, key)` is equivalent to the native index syntax `map[key]`. `lookup` should only be used with the third `default` argument, even though it is optional for backward compatibility.

## How To Fix

Expand Down
3 changes: 2 additions & 1 deletion rules/preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var PresetRules = map[string][]tflint.Rule{
NewTerraformCommentSyntaxRule(),
NewTerraformDeprecatedIndexRule(),
NewTerraformDeprecatedInterpolationRule(),
NewTerraformDeprecatedLookupRule(),
NewTerraformDocumentedOutputsRule(),
NewTerraformDocumentedVariablesRule(),
NewTerraformEmptyListEqualityRule(),
Expand All @@ -20,11 +21,11 @@ var PresetRules = map[string][]tflint.Rule{
NewTerraformUnusedDeclarationsRule(),
NewTerraformUnusedRequiredProvidersRule(),
NewTerraformWorkspaceRemoteRule(),
NewTerraformDeprecatedLookupRule(),
},
"recommended": {
NewTerraformDeprecatedIndexRule(),
NewTerraformDeprecatedInterpolationRule(),
NewTerraformDeprecatedLookupRule(),
NewTerraformEmptyListEqualityRule(),
NewTerraformModulePinnedSourceRule(),
NewTerraformModuleVersionRule(),
Expand Down