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 build
compile typescript to jsyarn watch
watch for changes and compileyarn test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template