gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
7.93k stars 965 forks source link

Expected way to tflint modules without a delivery repo? #2729

Open rtizzy opened 11 months ago

rtizzy commented 11 months ago

Not sure if I'm holding this the wrong way.

It's clear how one would be able to utilize tflint from the module repos via terragrunt for example, using after_hooks for validate.

What isn't clear is this:

If I'm making module level changes, how can these be linted and validated before merging them in?

I've been unable to find any reasonable way to accomplish this if I'm also defining provider versions in delivery.

Should I simply start managing provider versions at the module level instead?

denis256 commented 11 months ago

Hi, tflint integration is now available only through hooks, was considered to use hooks on validate command which is executed in pre-commit hooks? or run validate in CICD as a required step before merging the branch?

If terragrunt is not used at all in the repo... then explicit tflint calls can be used

rtizzy commented 11 months ago

@denis256 The modules themselves are intended to be used with terragrunt.

The idea I had was to utilize a single TF validate and tflint using terragrunt from modules.

Is there anyway to do that?

was considered to use hooks on validate command which is executed in pre-commit hooks?

Precommit hooks can be skipped hence the desire to run in CI. The CI won't "lie" about the outcome of the tests.