Skip to content

Commit 68133d4

Browse files
authored
chore(lambda-nodejs): update integration test for bundling (#33679)
### Issue # (if applicable) Closes #NA. ### Reason for this change Plan to change default user to a be non-root for bundling process. ### Description of changes - Added integration test for all packages that use dockerfile for bundling and will be affected with further changes. - Added bootstrap file binary to be identified as an LFS under .gitattribute - Updated contributing guide to let users know that git lfs install is needed to handle large file changes. ### Describe any new or updated permissions being added NA ### Description of how you validated changes yarn build yarn integ ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 6e0aa13 commit 68133d4

File tree

36 files changed

+72527
-0
lines changed

36 files changed

+72527
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616
packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-big-response.js.snapshot/asset.3322b7049fb0ed2b7cbb644a2ada8d1116ff80c32dca89e6ada846b5de26f961.zip filter=lfs diff=lfs merge=lfs -text
1717
packages/@aws-cdk-testing/framework-integ/test/**/*.snapshot/**/asset*.zip filter=lfs diff=lfs merge=lfs -text
1818
packages/@aws-cdk/*-alpha/test/**/*.snapshot/**/asset*.zip filter=lfs diff=lfs merge=lfs -text
19+
packages/@aws-cdk/*-alpha/test/*.snapshot/asset.*/bootstrap filter=lfs diff=lfs merge=lfs -text

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ Another reason we hear from authors that they don't want to publish their own pa
154154

155155
### Setup
156156
Fork the aws-cdk repository into your account: https://github.com/aws/aws-cdk/fork
157+
Note: Install Git LFS using `git lfs install` command, as it is necessary for handling large file changes.
157158

158159
Clone the forked repository:
159160
```console

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/BundlingUserTestDefaultTestDeployAssert0895CAA6.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/BundlingUserTestDefaultTestDeployAssert0895CAA6.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/asset.659fc275dc398d5f03ea5459bcc3898cca70adfa711dd30a29d749215d2990cb/index.js

+57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/cdk-integ-bundling-lambda-nodejs.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"Resources": {
3+
"tsdecoratorhandlerrootuserServiceRole7E60BF99": {
4+
"Type": "AWS::IAM::Role",
5+
"Properties": {
6+
"AssumeRolePolicyDocument": {
7+
"Statement": [
8+
{
9+
"Action": "sts:AssumeRole",
10+
"Effect": "Allow",
11+
"Principal": {
12+
"Service": "lambda.amazonaws.com"
13+
}
14+
}
15+
],
16+
"Version": "2012-10-17"
17+
},
18+
"ManagedPolicyArns": [
19+
{
20+
"Fn::Join": [
21+
"",
22+
[
23+
"arn:",
24+
{
25+
"Ref": "AWS::Partition"
26+
},
27+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
28+
]
29+
]
30+
}
31+
]
32+
}
33+
},
34+
"tsdecoratorhandlerrootuser49139373": {
35+
"Type": "AWS::Lambda::Function",
36+
"Properties": {
37+
"Code": {
38+
"S3Bucket": {
39+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
40+
},
41+
"S3Key": "659fc275dc398d5f03ea5459bcc3898cca70adfa711dd30a29d749215d2990cb.zip"
42+
},
43+
"Handler": "index.handler",
44+
"Role": {
45+
"Fn::GetAtt": [
46+
"tsdecoratorhandlerrootuserServiceRole7E60BF99",
47+
"Arn"
48+
]
49+
},
50+
"Runtime": "nodejs18.x"
51+
},
52+
"DependsOn": [
53+
"tsdecoratorhandlerrootuserServiceRole7E60BF99"
54+
]
55+
}
56+
},
57+
"Parameters": {
58+
"BootstrapVersion": {
59+
"Type": "AWS::SSM::Parameter::Value<String>",
60+
"Default": "/cdk-bootstrap/hnb659fds/version",
61+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
62+
}
63+
},
64+
"Rules": {
65+
"CheckBootstrapVersion": {
66+
"Assertions": [
67+
{
68+
"Assert": {
69+
"Fn::Not": [
70+
{
71+
"Fn::Contains": [
72+
[
73+
"1",
74+
"2",
75+
"3",
76+
"4",
77+
"5"
78+
],
79+
{
80+
"Ref": "BootstrapVersion"
81+
}
82+
]
83+
}
84+
]
85+
},
86+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
87+
}
88+
]
89+
}
90+
}
91+
}

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.bundling-user.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)