Deploy serverless hello world app to AWS using AWS CDK, API Gateway and Lambda (Node.js + TypeScript).
The cdk.json
file tells the CDK Toolkit how to execute your app.
- AWS Free Tier
- AWS CDK
- AWS CloudFormation
- AWS S3
- AWS DynamoDB
- AWS ECR
- AWS SSM
- AWS API Gateway
- AWS Lambda (Node.js)
- AWS SDK for JavaScript
- AWS IAM
- Created IAM user with user group that has full access permissions for CloudFormation, API Gateway, Lambda and DynamoDB
- Configured MFA on the IAM user
- Installed AWS CLI tool (MSI installer)
- Installed AWS CDK CLI tool (
npm i -g aws-cdk
) - Init a CDK app using
cdk init app --language typescript
- Create a hello world Lambda API Gateway
- Extended user group permissions to include full access to IAM, ECR, S3 and SSM
- Run
cdk bootstrap
to prepare AWS account to deploy CDK apps, it sets up an S3 bucket and a DynamoDB table that the CDK uses to store and manage your deployment assets and state (see CloudFormation > CDKToolkit stack) - Deploy stack to AWS using
cdk deploy
- Test using postman
- Destroy stack from AWS using
cdk destroy
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run 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