Debugging lambda locally using cdk not sam

You can use SAM and CDK together as described here. In particular:

  1. Run your AWS CDK app and create a AWS CloudFormation template

    cdk synth --no-staging > template.yaml

  2. Find the logical ID for your Lambda function in template.yaml. It will look like MyFunction12345678, where 12345678 represents an 8-character unique ID that the AWS CDK generates for all resources. The line right after it should look like: Type: AWS::Lambda::Function

  3. Run the function by executing:

    sam local invoke MyFunction12345678 --no-event

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top