github.com/wata727/tflint@v0.12.2-0.20191013070026-96dd0d36f385/docs/guides/config.md (about) 1 # Configuring TFLint 2 3 You can change the behavior not only in CLI flags but also in configuration files. By default, TFLint looks up `.tflint.hcl` according to the following priority: 4 5 - Current directory (`./.tflint.hcl`) 6 - Home directory (`~/.tflint.hcl`) 7 8 The config file is written in [HCL](https://github.com/hashicorp/hcl/tree/hcl2). An example is shown below: 9 10 ```hcl 11 config { 12 module = true 13 deep_check = true 14 force = false 15 16 aws_credentials = { 17 access_key = "AWS_ACCESS_KEY" 18 secret_key = "AWS_SECRET_KEY" 19 region = "us-east-1" 20 } 21 22 ignore_module = { 23 "github.com/wata727/example-module" = true 24 } 25 26 varfile = ["example1.tfvars", "example2.tfvars"] 27 28 variables = ["foo=bar", "bar=[\"baz\"]"] 29 } 30 31 rule "aws_instance_invalid_type" { 32 enabled = false 33 } 34 35 rule "aws_instance_previous_type" { 36 enabled = false 37 } 38 ``` 39 40 You can also use another file as a config file with the `--config` option: 41 42 ``` 43 $ tflint --config other_config.hcl 44 ``` 45 46 ## `module` 47 48 CLI flag: `--module` 49 50 Enable [Module inspection](advanced.md#module-inspection). 51 52 ## `deep_check` 53 54 CLI flag: `--deep` 55 56 Enable [Deep checking](advanced.md#deep-checking). 57 58 ## `force` 59 60 CLI flag: `--force` 61 62 Return zero exit status even if issues found. TFLint returns non-zero exit status by default. See [Exit statuses](../../README.md#exit-statuses). 63 64 ## `aws_credentials` 65 66 CLI flag: `--aws-access-key`, `--aws-secret-key`, `--aws-profile`, `--aws-creds-file` and `--aws-region` 67 68 Configure AWS service crendetials. See [Credentials](credentials.md). 69 70 ## `ignore_module` 71 72 CLI flag: `--ignore-module` 73 74 Skip inspections for the specified comma-separated module calls. Note that you need to pass module sources rather than module ids for backward compatibility. See [Module inspection](advanced.md#module-inspection). 75 76 ## `varfile` 77 78 CLI flag: `--var-file` 79 80 Set Terraform variables from `tfvars` files. If `terraform.tfvars` or any `*.auto.tfvars` files are present, they will be automatically loaded. 81 82 ## `variables` 83 84 CLI flag: `--var` 85 86 Set a Terraform variable from a passed value. This flag can be set multiple times. 87 88 ## `rule` blocks 89 90 CLI flag: `--enable-rule`, `--disable-rule` 91 92 You can make settings for each rule in the `rule` block. Currently, it can set only `enabled` option. If you set `enabled = false`, TFLint doesn't inspect configuration files by this rule. 93 94 ```hcl 95 rule "aws_instance_previous_type" { 96 enabled = false 97 } 98 ```