Open akash1810 opened 8 months ago
Error Annotations should prevent template synthesis in all scenarios.
Generally agree with you but we'll need more inputs from the maintainers. Thank you for the report.
Agree, this would especially make it easier to test the implementations of Aspects themselves, to make sure they fail in the right scenarios, and don't in the wrong ones.
Describe the bug
With a
Stack
of:We get errors via
Annotations
atsynth
time:However, with a unit test of:
npm test
does not observe the errorAnnotations
. More specifically,Template.fromStack
does not observeAnnotations
.IIUC
Template.fromStack
is in the synth step^1, so it's curious that errorAnnotations
are not observed. Is this correct? Should an errorAnnotation
prevent a stack from being synthed in all scenarios?Expected Behavior
Error
Annotations
should prevent template synthesis in all scenarios.Current Behavior
Error
Annotations
do not cause errors in unit tests.Reproduction Steps
See above.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.126.0 (build fb74c41)
Framework Version
No response
Node.js Version
v20.10.0
OS
macOS 14.3
Language
TypeScript
Language Version
TypeScript 5.3.3
Other information
Code examples are taken from https://aws.amazon.com/blogs/devops/manage-application-security-and-compliance-with-the-aws-cloud-development-kit-and-cdk-nag/.
I don't think this is an issue with cdk-nag, but with
Annotations
. Hence raising this issue here. Let me know if this is incorrect though.