Skip to content

Commit 5ed7d12

Browse files
authored
Revise rules documentation (#158)
1 parent 6ace801 commit 5ed7d12

13 files changed

+19
-17
lines changed

docs/rules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ All rules are enabled by default, but by setting `preset = "recommended"`, you c
2222
|[terraform_typed_variables](terraform_typed_variables.md)|Disallow `variable` declarations without type||
2323
|[terraform_unused_declarations](terraform_unused_declarations.md)|Disallow variables, data sources, and locals that are declared but never used||
2424
|[terraform_unused_required_providers](terraform_unused_required_providers.md)|Check that all `required_providers` are used in the module||
25-
|[terraform_workspace_remote](terraform_workspace_remote.md)|`terraform.workspace` should not be used with a "remote" backend with remote execution||
25+
|[terraform_workspace_remote](terraform_workspace_remote.md)|`terraform.workspace` should not be used with a "remote" backend with remote execution in Terraform v1.0.x||

docs/rules/terraform_comment_syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
2525

2626
The Terraform language supports two different syntaxes for single-line comments: `#` and `//`. However, `#` is the default comment style and should be used in most cases.
2727

28-
* [Configuration Syntax: Comments](https://www.terraform.io/docs/configuration/syntax.html#comments)
28+
* [Configuration Syntax: Comments](https://developer.hashicorp.com/terraform/language/syntax/configuration#comments)
2929

3030
## How To Fix
3131

docs/rules/terraform_deprecated_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
4646

4747
## Why
4848

49-
Terraform v0.12 supports traditional square brackets for accessing list items by index or using the splat operator (`*`). However, for backward compatibility with v0.11, Terraform continues to support accessing list items with the dot syntax normally used for attributes. While Terraform does not print warnings for this syntax, it is no longer documented and its use is discouraged.
49+
Terraform supports traditional square brackets for accessing list items by index or using the splat operator (`*`). However, for backward compatibility, Terraform continues to support accessing list items with the dot syntax normally used for attributes. While Terraform does not print warnings for this syntax, it is no longer documented and its use is discouraged.
5050

5151
* [Legacy Splat Expressions](https://developer.hashicorp.com/terraform/language/expressions/splat#legacy-attribute-only-splat-expressions)
5252

docs/rules/terraform_deprecated_interpolation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
3333

3434
Terraform v0.12 introduces a new interpolation syntax, but continues to support the old 0.11-style interpolation syntax for compatibility.
3535

36-
Terraform will currently print diagnostic warnings when deprecated interpolations are used. Consistent with its deprecation policy, they will raise errors in the next major release (v0.13). TFLint emits an issue instead of a warning with the same logic.
36+
`terraform fmt` can replace this redundant interpolation, so although it is not deprecated in the latest Terraform version, this rule allows you to issue a warning similar to Terraform v0.12.14.
3737

3838
## How To Fix
3939

docs/rules/terraform_documented_outputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
4242

4343
## Why
4444

45-
Since `description` is optional value, it is not always necessary to write it. But this rule is useful if you want to force the writing of description. Especially it is useful when combined with [terraform-docs](https://github.com/segmentio/terraform-docs).
45+
Since `description` is optional value, it is not always necessary to write it. But this rule is useful if you want to force the writing of description. Especially it is useful when combined with [terraform-docs](https://github.com/terraform-docs/terraform-docs).
4646

4747
## How To Fix
4848

docs/rules/terraform_documented_variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
4242

4343
## Why
4444

45-
Since `description` is optional value, it is not always necessary to write it. But this rule is useful if you want to force the writing of description. Especially it is useful when combined with [terraform-docs](https://github.com/segmentio/terraform-docs).
45+
Since `description` is optional value, it is not always necessary to write it. But this rule is useful if you want to force the writing of description. Especially it is useful when combined with [terraform-docs](https://github.com/terraform-docs/terraform-docs).
4646

4747
## How To Fix
4848

docs/rules/terraform_module_version.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# terraform_module_version
22

3-
Ensure that all modules sourced from a [Terraform Registry](https://www.terraform.io/docs/language/modules/sources.html#terraform-registry) specify a `version`.
3+
Ensure that all modules sourced from a [Terraform Registry](https://developer.hashicorp.com/terraform/language/modules/sources#terraform-registry) specify a `version`.
44

55
> This rule is enabled by "recommended" preset.
66
@@ -82,17 +82,17 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/v0.1.0/
8282

8383
## Why
8484

85-
Terraform's [module version documentation](https://www.terraform.io/docs/language/modules/syntax.html#version) states:
85+
Terraform's [module version documentation](https://developer.hashicorp.com/terraform/language/modules/syntax#version) states:
8686

8787
> When using modules installed from a module registry, we recommend explicitly constraining the acceptable version numbers to avoid unexpected or unwanted changes.
8888
8989
When no `version` is specified, Terraform will download the latest version available on the registry. Using a new major version of a module could cause the destruction of existing resources, or the creation of new resources that are not backwards compatible. Generally you should at least constrain modules to a specific major version.
9090

9191
### Exact Versions
9292

93-
Depending on your workflow, you may want to enforce that modules specify an _exact_ version by settings `exact = true` for this rule. This will disallow any module that includes multiple comma-separated version constraints, or any [constraint operator](https://www.terraform.io/docs/language/expressions/version-constraints.html#version-constraint-syntax) other than `=`. Exact versions are often used with automated dependency managers like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates) and [Renovate](https://docs.renovatebot.com), which will automatically propose a pull request to update the module when a new version is released.
93+
Depending on your workflow, you may want to enforce that modules specify an _exact_ version by settings `exact = true` for this rule. This will disallow any module that includes multiple comma-separated version constraints, or any [constraint operator](https://developer.hashicorp.com/terraform/language/expressions/version-constraints#version-constraint-syntax) other than `=`. Exact versions are often used with automated dependency managers like [Dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates) and [Renovate](https://docs.renovatebot.com), which will automatically propose a pull request to update the module when a new version is released.
9494

95-
Keep in mind that the module may include further child modules, which have their own version constraints. TFLint _does not_ check version constraints set in child modules. **Enabling this rule cannot guarantee that `terraform init` will be deterministic**. Use [Terraform dependency lock files](https://www.terraform.io/docs/language/dependency-lock.html) to ensure that Terraform will always use the same version of all modules (and providers) until you explicitly update them.
95+
Keep in mind that the module may include further child modules, which have their own version constraints. TFLint _does not_ check version constraints set in child modules. **Enabling this rule cannot guarantee that `terraform init` will be deterministic**. Use [Terraform dependency lock files](https://developer.hashicorp.com/terraform/language/files/dependency-lock) to ensure that Terraform will always use the same version of all modules (and providers) until you explicitly update them.
9696

9797
## How To Fix
9898

docs/rules/terraform_naming_convention.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
279279

280280
## Why
281281

282-
Naming conventions are optional, so it is not necessary to follow this.
283-
But this rule is useful if you want to force the following naming conventions in line with the [Terraform Plugin Naming Best Practices](https://www.terraform.io/docs/extend/best-practices/naming.html).
282+
Naming conventions are optional, so you don't necessarily have to follow them.
283+
However, if your team owns Terraform configurations, it can be helpful to have a consistent naming convention.
284284

285285
## How To Fix
286286

docs/rules/terraform_required_providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,6 @@ terraform {
136136
}
137137
```
138138

139-
Provider version constraints can be specified using a [version argument within a provider block](https://www.terraform.io/docs/configuration/providers.html#provider-versions) for backwards compatibility. This approach is now discouraged, particularly for child modules.
139+
Provider version constraints can be specified using a [version argument within a provider block](https://developer.hashicorp.com/terraform/language/providers/configuration#provider-versions) for backwards compatibility. This approach is now discouraged, particularly for child modules.
140140

141141
Optionally, you can disable enforcement of either `source` or `version` by setting the corresponding attribute in the rule configuration to `false`.

docs/rules/terraform_standard_module_structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# terraform_standard_module_structure
22

3-
Ensure that a module complies with the Terraform [Standard Module Structure](https://www.terraform.io/docs/modules/index.html#standard-module-structure)
3+
Ensure that a module complies with the Terraform [Standard Module Structure](https://developer.hashicorp.com/terraform/language/modules/develop/structure)
44

55
## Example
66

@@ -23,7 +23,7 @@ Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0
2323

2424
## Why
2525

26-
Terraform's documentation outlines a [Standard Module Structure](https://www.terraform.io/docs/modules/structure.html). 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.
26+
Terraform's documentation outlines a [Standard Module Structure](https://developer.hashicorp.com/terraform/language/modules/develop/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.
2727

2828
## How To Fix
2929

0 commit comments

Comments
 (0)