Template for AWS Lambda function
This is a AWS Lambda function template with CDK. The AWS Lambda's runtime is Python 3.8.
Quick Start
git clone https://github.com/msysh/cdk-template-lambda.git
cd cdk-template-lambda
-
npm install
oryarn install
-
cdk bootstrap
, if you've never execute yet. cdk deploy
Customize
AWS Lambda function
Add files you want for AWS Lambda, into assets
.
Others
- Lambda function name :
functionName
incdk.json
. Default ismy_function
. - IAM role name :
roleName
incdk.json
. Default isrole_for_my_function
.
The cdk.json
file tells the CDK Toolkit how to execute your app.
Useful commands
-
npm run build
compile typescript to js -
npm run watch
watch for changes and compile -
npm run test
perform the jest unit tests -
cdk deploy
deploy this stack to your default AWS account/region -
cdk diff
compare deployed stack with current state -
cdk synth
emits the synthesized CloudFormation template