A boilerplate for the deployment of lambda with api gateway on AWS with CDK and TypeScript.
You can read the complete article on medium
-
Clone repo:
git clone https://github.com/ikramdeveloper/lambda-api-cdk-deployment.git
-
Go to directory:
cd lambda-api-cdk-deployment
-
Install dependencies:
npm i
You can find the code of lambda inside services/lambda directory
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testsnpx cdk deploy
deploy this stack to your default AWS account/regionnpx cdk diff
compare deployed stack with current statenpx cdk synth
emits the synthesized CloudFormation template