Closed alnoki closed 2 months ago
Duplicate #1888. We would need to add support for Rules.
@kddejong unfortunately with v1.14.2
the reproduction template still throws the same error described above, despite #3634's inclusion in v1.12.0
. Did you verify #3634 against the reproduction template I provided above?
Yea, but with the change of Fn::Not: !Condition 'ProvisionVpc'
to Fn::Not: [!Condition 'ProvisionVpc']
. I suppose it is possible the Rules version of the Fn::Not supports a none list but the docs say to use a list.
Also as provided by the CloudFormation service Template error: Fn::Not requires a list argument with one element
@kddejong thanks for the followup and for the docs references.
I updated a template I was actually using with the new list-based Fn::Not
style and my lints passed, but then I was unable to deploy a changeset: it appears that !Condition
is not a supported rule-specific intrinsic function, so I've filed #3710 accordingly
Working on the Condition portion of this today.
CloudFormation Lint Version
1.11.0
What operating system are you using?
Mac
pre-commit
Describe the bug
The reproduction template throws:
Specifically, the purported hypothetical situation
is impossible per the
ProvisionVpc
rule.Expected behavior
The lint should pass, without having to duplicate
ProvisionVpc
rule logic in theProvisionVpc
condition. E.g. while updating the condition to:results in a successful lint, this situation requires duplicate definitions just to satisfy the linter, thus reducing maintainability.
Moreover, since
cfn-lint
's static analysis is based off of conditions instead of rules (presumably, based on the reproduction template), templates that pass lints might not preserve the intended behavior if a cascaded condition is added without an accompanying duplicate rule.Reproduction template