You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Follow this [getting started with CDK guide](https://docs.aws.amazon.com/cdk/v1/guide/getting_started.html){:target="_blank" rel="noopener"}
8
8
- Make sure your AWS account and machine can deploy an AWS Cloudformation stack and have all the tokens and configuration as described in the page above.
9
-
- CDK Best practices [blog](https://github.com/ran-isenberg/aws-lambda-handler-cookbook){:target="_blank" rel="noopener"}
9
+
- CDK Best practices [blog](https://www.ranthebuilder.cloud/post/aws-cdk-best-practices-from-the-trenches){:target="_blank" rel="noopener"}
10
+
- Lambda layers best practices [blog](https://www.ranthebuilder.cloud/post/aws-lambda-layers-best-practice){:target="_blank" rel="noopener"}
10
11
11
12
## **CDK Deployment**
12
13
@@ -39,16 +40,16 @@ All ASW Lambda function configurations are saved as constants at the `cdk.my_ser
39
40
40
41
- AWS Cloudformation stack: **cdk.my_service.service_stack.py** which is consisted of one construct
41
42
- Construct: **cdk.my_service.api_construct.py** which includes:
42
-
-**Lambda Layer** - deployment optimization meant to be used with multiple handlers under the same API GW, sharing code logic and dependencies. You can read more about it in Yan - Cui's [blog](https://medium.com/theburningmonk-com/lambda-layer-not-a-package-manager-but-a-deployment-optimization-85ddcae40a96){:target="_blank" rel="noopener"}
43
+
-**Lambda Layer** - deployment optimization meant to be used with multiple handlers under the same API GW, sharing code logic and dependencies. You can read more about it [here.](https://www.ranthebuilder.cloud/post/aws-lambda-layers-best-practice){:target="_blank" rel="noopener"}
43
44
-**Lambda Function** - The Lambda handler function itself. Handler code is taken from the service `folder`.
44
45
-**Lambda Role** - The role of the Lambda function.
45
46
-**API GW with Lambda Integration** - API GW with a Lambda integration POST /api/orders that triggers the Lambda function.
46
47
-**AWS DynamoDB table** - stores request data. Created in its own construct: api_db_construct.py
47
48
48
-
### **CDK Tests**
49
+
### **Infrastructure CDK & Security Tests**
49
50
50
-
Under E2E tests there is a folder `test_infra`for infrastructure tests.
51
+
Under tests there is an `infrastructure` folder for CDK & security infrastructure tests.
51
52
52
-
First test 'test_cdk' uses CDK's testing framework which asserts that required resources exists so the application will not break anything upon deployment.
53
+
The first test, 'test_cdk' uses CDK's testing framework which asserts that required resources exists so the application will not break anything upon deployment.
53
54
54
-
Second test 'test_cdk_nag' checks your cloudformation output for security best practices. For more information click [here](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/check-aws-cdk-applications-or-cloudformation-templates-for-best-practices-by-using-cdk-nag-rule-packs.html){:target="_blank" rel="noopener"}.
55
+
The second test, 'test_cdk_nag' checks your cloudformation output for security best practices. For more information click [here](https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/check-aws-cdk-applications-or-cloudformation-templates-for-best-practices-by-using-cdk-nag-rule-packs.html){:target="_blank" rel="noopener"}.
0 commit comments