atmos terraform lint
Run TFLint against Atmos Terraform components without repeating work for components used by multiple stacks.
Usage
Run atmos terraform lint [component] [flags].
Examples
# Lint every Terraform component once (the default)
atmos terraform lint
atmos terraform lint --all
# Lint a component, selecting a stack automatically when it is used by more than one stack
atmos terraform lint vpc
# Lint the component instance selected by a stack
atmos terraform lint vpc --stack test
# Lint Terraform components affected by the current change
atmos terraform lint --affected
--all and the no-argument form select all Terraform components. Atmos selects
a deterministic stack context for each component so toolchain and stack-specific
settings can be resolved, but runs TFLint just once per component directory.
TFLint configuration
Atmos detects TFLint configuration in this order:
- An explicit
--configargument configured on a TFLint hook or workflow step. - A
.tflint.hclfile in the component directory. - A
.tflint.hclfile in the Terraform components base path. - A
.tflint.hclfile at the Git repository root. - The optional project-wide
components.terraform.lint.configsetting.
For example, configure a global fallback in atmos.yaml:
components:
terraform:
lint:
config: .tflint.hcl
The closest standard path wins: component directory, then components base path, then repository root. The configured path may be absolute or relative to the Atmos base path and is used only when none of those files exists.
Flags
--all- Lint all Terraform components. This is the default when no component is provided.
--affected- Lint Terraform components selected by Atmos change detection.
--stack/-s- Limit selection to one stack, or choose the stack context for a named component.