I am struggling to debug lambdas managed by CDK.
My CDK source is almost same to the sample below provided by AWS.
https://github.com/aws-samples/cdk-pipelines-demo/tree/typescript
The source structure is as follows:
--project_dir/
|_cdk.json
|_pipelines_webinar/
|_lambda/
|_handler.ts <====== I WANT TO EXECUTE AND DEBUG ON LOCAL THIS.
|_pipeline_stack.ts
|_pipelines_webinar_stack.ts
|_webservice_stage.ts
I think that it needs to use SAM CLI to run and debug locally.
But, If I run cdk synth to create SAM Template, Lambda function (Type: AWS::Lambda::Function) does not exist in the created SAM Template.
I think this behavior is because lambda is deployed by CDK pipeline.
Here's how to reproduce the situation:
git clone -b typescript https://github.com/aws-samples/cdk-pipelines-demo.git
cd cdk-pipelines-demo
npm install
cdk synth > template.yml
Q. Is there any way to run and debug lambda locally in this situation?