This is by no means the de facto way to do things. AWS CDK is relatively new, and there are too much information to digest. Hence, I'm writing on account of what I use in my daily work for knowledge sharing.
If you find anything useful or erratas, reach me and comment on my page at https://gefyra.co/getting-started-with-aws-cdk/.
This repo contains the code references in my website at: https://gefyra.co/category/tutorials/data-engineering/aws-cdk/
Each tutorial will reference a git branch. For example, Preparing Your AWS CDK Framework
will reference CDK-T1
.
The master branch will contain the latest tutorial reference, but individual tutorials can be referenced by the branch name.
- Getting Started With AWS CDK - No branch
- Preparing Your AWS CDK Framework - CDK-T1
- Creating An S3 Bucket With AWS CDK - CDK-T2
- Creating A basic Lambda Function with AWS CDK - CDK-T3
- Connecting S3 with Lambda on AWS CDK - CDK-T4
- Simple Unit Test For AWS Lambda - TEST-1
- How To Upgrade Your AWS CDK Stack To Version 2 In Typescript - CDK-T5
Basic Lambda: CDK-T3
- Run:
npm run build && cdk synth
- Run:
cdk deploy basicLambdaStack
- If you're running against with a customized profile, use:
cdk deploy <stack name> --profile <aws profile name>
- If you're running against with a customized profile, use:
Simple Unit Test For AWS Lambda: TEST-1
We use pipenv
to isolate our python environment for our Lambda deployment.
Run coverage run -m pytest <test_script> --pylint
to test and to generate a test coverage report.
Run coverage report
to generate a summarized report.
Run coverage html
to generate visualization and breakdown of the test.