(assertions): Should Annotations
impact unit tests?
#29047
Labels
@aws-cdk/assertions
Related to the @aws-cdk/assertv2 package
@aws-cdk/aws-s3
Related to Amazon S3
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
needs-review
p2
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 step1, 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.Footnotes
https://docs.aws.amazon.com/cdk/v2/guide/apps.html#lifecycle ↩
The text was updated successfully, but these errors were encountered: