-
Notifications
You must be signed in to change notification settings - Fork 376
Description
Introduction
I have a git repo with lots of directories that represent my deployed infrastructure. I'm using the Gruntwork infrastructure-live setup as can be seen in their example.
In my directories that start with /dev
which represent my dev infrastructure. I want to allow main
as a target for terraform module source
lines so that I can deploy to DEV work that is not yet tagged/released such as:
module "my-app" {
source = "git::ssh://git@bitbucket.org/my-org/my-repo.git//terraform?ref=main"
// etc
}
In my qa and prod directories, I want to allow only released version tags and NOT allow main
such as:
module "my-app" {
source = "git::ssh://git@bitbucket.org/my-org/my-repo.git//terraform?ref=1.2.3"
// etc
}
This means I need to configure tflint differently depending on which directory tree I'm under. Specifically I want to disable the rule terraform_module_pinned_source
for my dev
environment but enable it for my qa and prod environments.
Proposal
Allow .tflint.hcl
files to "combine" if multiple files exist in defined locations. This would happen by looking "up" directories until the root is reached combining them into one where the more specific directory takes precedence. This would allow me to put "common" config into my home directory the root of /dev
to disable the rules I need to disable for my dev files
A slightly different solution is to not look in all directories, but define some locations, perhaps GLOBAL -> HOME DIR -> current directory. This solution is inspired withs how git config files work. Copying the git config solution would be very nice and consistent since many users are likely familiar with git config.
Thank you for this great tool!