A Simple CDK CRUD application with AWS Lambda , API Gateway V2 and DynamoDB
The cdk.json file tells the CDK Toolkit how to execute your app.
Getting Started Clone the repository.
git clone https://github.com/KaranGauswami/aws-cdk-serverless-starter.gitInstall the dependencies:
yarn install --frozen-lockfileDeploy the Stack:
yarn cdk deployThe output should resemble the following:
Outputs:
SampleAppStack.ApiEndpointUrl = https://h5iqvrqog7.execute-api.ap-south-1.amazonaws.com
Create an Item Using API:
curl --location '{ApiEndpointUrl}/items' --header 'Content-Type: application/json' --data '{"Name": "First Item"}'Get All Items Using API:
curl --location '{ApiEndpointUrl}/items'Make sure to replace {ApiEndpointUrl} with the actual API endpoint URL provided during the stack deployment.
yarn cdk destroyyarn run buildcompile typescript to jsyarn run watchwatch for changes and compileyarn run 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