-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
CFn: correctly skip conditionally disabled resources #13238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test Results - Alternative Providers577 tests 330 ✅ 26m 16s ⏱️ Results for commit ebf3c17. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 2h 39m 36s ⏱️ Results for commit ebf3c17. |
pinzon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Glad the new engine is easily modifiable.
|
|
||
| @markers.aws.validated | ||
| @pytest.mark.skipif(condition=not is_aws_cloud(), reason="not supported yet") | ||
| @skip_if_legacy_engine() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Consider adding a validation test about a situation where an output references a conditionally skip resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, thanks! I'll tackle this in a follow up
Motivation
When a template resource which is disabled by a condition references another resource that's disabled by a condition, the CFn engine currently incorrectly raises a
ValidationErrorin the transformer, validator and executor. This is not in parity with AWS. See thereferences_to_conditions.ymltemplate for an example.Changes
visit_node_resources/visit_node_outputsentirely in the preproc so we don't even evaluate the resource block during template preprocessing time