Ravi Sir's Cards › AWS
How do you test CDK?
This interview card answers: How do you test CDK? Use assertions on the synthesized template (fine-grained + snapshot) in unit tests. Fail CI if a public S3 bucket appears in the template. Expect(stack).toHaveResource("AWS::S3::Bucket", { PublicAccessBlockConfiguration:. }).
Read card text
What this card says
What it is
Use assertions on the synthesized template (fine-grained + snapshot) in unit tests.
Template.fromStack
Why it matters
Fail CI if a public S3 bucket appears in the template.
How / example
expect(stack).toHaveResource("AWS::S3::Bucket", { PublicAccessBlockConfiguration: ... }).