You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that I described similar behavior in #3630, which #3634 and #3703 attempted to address. Unfortunately it appears that these changes resulted in cfn-lint allowing the Condition function inside of rules, which is not an allowed rule-specific intrinsic function.
In particular, templates of the form described at #3630 (comment) will throw:
Changeset creation failed. The reason was Template format error: Following functions are not supported in the Rules block of the template: [Condition].
Describe the bug
The reproduction template throws:
W1001 Ref to resource 'InternetGateway' that may not be available when condition 'DeployGateway' is False and when condition 'DeployVpc' is True at Resources/InternetGatewayAttachment/Properties/InternetGatewayId
src/cloud-formation/indexer.cfn.yaml:32:7
Specifically, the purported hypothetical situation
when condition 'DeployGateway' is False and when condition 'DeployVpc' is True
is impossible per the DeployVpc rule.
Expected behavior
The lint should pass without template modification.
alnoki
changed the title
[Bug] Inaccurate condition evaluation when using rules
[Bug] Rules support Condition, which is not a rule-specific intrinsic function
Sep 24, 2024
CloudFormation Lint Version
1.15.0
What operating system are you using?
Mac
pre-commit
Background
Note that I described similar behavior in #3630, which #3634 and #3703 attempted to address. Unfortunately it appears that these changes resulted in
cfn-lint
allowing theCondition
function inside of rules, which is not an allowed rule-specific intrinsic function.In particular, templates of the form described at #3630 (comment) will throw:
Describe the bug
The reproduction template throws:
Specifically, the purported hypothetical situation
is impossible per the DeployVpc rule.
Expected behavior
The lint should pass without template modification.
Reproduction template
The text was updated successfully, but these errors were encountered: