0
votes

I have a node CDK project with some python lambdas, I have put some code into the handler of the lambda that i have specified in my stack this being the execute function. I add some gibberish into the start of that function so it would fail or not be valid. I type cdk synth this still generates a template, shouldn't this do some validation on the lambdas, if not how do we validate these lambdas before deploying? Thanks

1
Try to run npm run build before cdk synthAmit Baranes
Tried it but it didn't seem to helpAnonymousAlias

1 Answers

2
votes

From the AWS documentation:

The Toolkit provides the ability to convert one or more AWS CDK stacks to AWS CloudFormation templates and related assets (a process called synthesis) and to deploy your stacks to an AWS account.

The cdk synth does not do any additional validation on the underlying Cloudformation resources -- it simply converts the CDK code into Cloudformation templates.

You have to add in this functionality yourself before deployment. One way to achieve this could be running a local SAM test suite.