This is an adaption of the WildRydes serverless ticketing workshop for my own personal use and of course built with CDK!
Local testing of lambda's can be done use AWS SAM
Build the lambdas
yarn build
Generate the template.yaml
yarn sam-template
Start local DynamoDB
docker network create sam-network
yarn start-db
Start local API Gateway
yarn start-api
Build the lambdas
yarn build
Generate the template.yaml
yarn sam-template
The find the logical id of the lambda you want to invoke in the template.yaml and invoke with sam
yarn invoke-local-lambda --lambdaDir lambda/tickets-get
yarn buildcompile typescript to jsyarn watchwatch for changes and compileyarn testperform the jest unit testscdk deploydeploy this stack to your default AWS account/regioncdk diffcompare deployed stack with current statecdk synthemits the synthesized CloudFormation template