stelligent / config-lint

Command line tool to validate configuration files
https://stelligent.github.io/config-lint/#/
MIT License
193 stars 39 forks source link

in a custom TF, when resources is not specified, it ignores the category and checks everything #135

Closed kidbrax closed 4 years ago

kidbrax commented 4 years ago

if I specify this rule with the category set to module but resources not set:

- id: CORRECT_DEPLOYMENT_STAGE_PROVIDER
    message: "Provider account must contain correct stage"
    category: module
    assertions:
      - key: providers[0].aws
        op: contains
        value_from:
          variable: ds
        severity: FAILURE

I would expect it to test all modules, but instead it checks everything. You can see the error message here showing that it checked the provider category:

` ``` { "AssertionMessage": "providers[0].aws does not contain test", "Category": "provider", "CreatedAt": "2020-02-20T21:51:10Z", "Filename": "test/rds/providers.tf", "LineNumber": 0, "ResourceID": "20", "ResourceType": "aws", "RuleID": "CORRECT_DEPLOYMENT_STAGE_PROVIDER", "RuleMessage": "Provider account must contain correct stage", "Status": "FAILURE" },

kmonihen commented 4 years ago

Should be fixed https://github.com/stelligent/config-lint/pull/167