Closed mikelax closed 3 years ago
As a follow up, I was able to get this working. I think the root cause was a recent change in tflint. Look at the changelog for version 0.23.0, you can see there was a change to the aws ruleset.
I added the plugin
attribute to my .tflint.hcl config as below and now things are working.
config {
}
plugin "aws" {
enabled = true
}
rule "aws_db_instance_default_parameter_group" {
enabled = false
}
Good that you found the solution. In modules we are using --only
directives, for eg:
- id: terraform_tflint
args:
- '--args=--only=terraform_deprecated_interpolation'
- '--args=--only=terraform_deprecated_index'
- '--args=--only=terraform_unused_declarations'
- '--args=--only=terraform_comment_syntax'
- '--args=--only=terraform_documented_outputs'
- '--args=--only=terraform_documented_variables'
- '--args=--only=terraform_typed_variables'
- '--args=--only=terraform_module_pinned_source'
- '--args=--only=terraform_naming_convention'
- '--args=--only=terraform_required_version'
- '--args=--only=terraform_required_providers'
- '--args=--only=terraform_standard_module_structure'
- '--args=--only=terraform_workspace_remote'
I am going to close this issue.
Overview
As a user, I want to disable certain "aws" rules when using the
terraform_tflint
hook. Currently I receive an error when I specify an arg using thedisable-rule=aws_db_instance_default_parameter_group
value.pre-commit-terraform Broken Example
This file returns an error when run
This file runs and reports the lint error
tflint Working Example
When I run tflint manually and specify an aws rule using the
--disable-rule
attribute things work correctly.Runs and reports no errors
tflint --disable-rule=aws_db_instance_default_parameter_group example/project/folder
Runs and reports lint error
tflint example/project/folder