You can use SAM and CDK together as described here. In particular:
Run your AWS CDK app and create a AWS CloudFormation template
cdk synth --no-staging > template.yaml
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
Run the function by executing:
sam local invoke MyFunction12345678 --no-event
CLICK HERE to find out more related problems solutions.