liveBook · Manning

TFLint configuration file

As explained in Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu

A TFLint configuration file is an HCL file that declares TFLint plugins, rule presets, enabled rules, and excluded rules for a project.

When Terraform quality checks need project-specific rules, place them in a root-level .tflint.hcl file. The file declares plugins, selects rule presets, enables extra rules, and disables exceptions. section 7.3.3

Install plugins and run the checks

A Makefile target can run tflint --init before tflint. Initialization downloads configured plugins locally; the lint run then reports issues such as missing required_version or an unused required provider. Specific unavoidable findings can use an inline tflint-ignore comment.

How Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu covers it

How deep it goes
Explains declarations, presets, plugin installation, rule overrides, and inline exceptions, but not plugin implementation internals.
Examples
Uses Terraform, AWS, AzureRM, and Google plugin configurations plus Makefile commands and reported lint findings.
What you can do after
Operate TFLint by configuring plugins and rules, initializing them locally, running checks, and handling justified exceptions.
How it connects
Connects Terraform, TFLint plugins, cloud providers, Open Policy Agent, Makefiles, and continuous integration.

This explainer was generated by Manning's knowledge graph from the text of Terraform in Depth: Infrastructure as Code with Terraform and OpenTofu. The section links point to the parts of the book it draws on.