This is a serverless project using TypeScript with AWS CDK. This is a simple project setup using Projen
- Node version 14 or later
- npm version 7 or later
- awscli v2
- AWS CDK Toolkit
- Projen
- AWS API Gateway
- AWS Lambda Function
To start the Development,
- Clone the project to your local machine
git clone <repository-name>
- Run
yarn install
to setup the package dependencies in the root project.
yarn install
- Use the projen commands to refelct any changes to the code.
npx projen
The cdk.json
file tells the CDK Toolkit how to execute your app.
npx projen build
compile typescript to jsnpx projen watch
watch for changes and compileyarn test
perform the jest unit tests
To build the project, run yarn build
in the root project. This command will run npm run build on all packages.
Various scripts are predefined in the package.json
generated from projen.
Run the test with yarn test
.
yarn build
also runs test, so omit the example output here.
The project has been used SAST from Sonarcloud to generate a report about the critical components in the project. The link for the report can be found Sonarcloud Report.
- Once the build is successful, try deploying locally.
$ cdk deploy --app='./lib/integ.default.js'
- You can check the response of the Lambda function from the output API URL.
$ curl https://4p9zxdfgy8.execute-api.ap-northeast-1.amazonaws.com/
"Hello from Lambda!"
- To delete the deployment.
$ cdk destroy --app='./lib/integ.default.js'
MIT License