Skip to content

Commit 53f4713

Browse files
authored
feat(lambda): add supportsSnapStart config to dotnet8 and python 3.12 (#32112)
### Issue # (if applicable) N/A ### Description of changes This change adds supportsSnapStart as true to dotnet8. This change is needed as Lambda Runtimes team is working on launching Snapstart support for dotnet8. Original PR raised by @Beau-Gosse-dev ### Description of how you validated changes Verified the change is the same as Python and Java. In addition, added new integ test ### 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 2f16415 commit 53f4713

14 files changed

+1202
-3
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-snapstart.js.snapshot/asset.a328343cb12aa16bf2c12bfa98f28509923cf8a0e9771cccbbe967d9e15c08f6/handler.cs

Lines changed: 16 additions & 0 deletions
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/test/integ.lambda-snapstart.js.snapshot/aws-cdk-lambda-runtime-management.assets.json

Lines changed: 45 additions & 0 deletions
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,256 @@
1+
{
2+
"Resources": {
3+
"JavaSnapstartLambdaServiceRole50CD4832": {
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+
"JavaSnapstartLambdaB19F6BA4": {
35+
"Type": "AWS::Lambda::Function",
36+
"Properties": {
37+
"Code": {
38+
"S3Bucket": {
39+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
40+
},
41+
"S3Key": "a37d3ef54c18e7738fe5dc008504591bd3b1f14c6a09ee91eac6d55f7ca5ba5f.zip"
42+
},
43+
"Handler": "Handler",
44+
"Role": {
45+
"Fn::GetAtt": [
46+
"JavaSnapstartLambdaServiceRole50CD4832",
47+
"Arn"
48+
]
49+
},
50+
"Runtime": "java11",
51+
"SnapStart": {
52+
"ApplyOn": "PublishedVersions"
53+
}
54+
},
55+
"DependsOn": [
56+
"JavaSnapstartLambdaServiceRole50CD4832"
57+
]
58+
},
59+
"Python312SnapstartLambdaServiceRole16F303C0": {
60+
"Type": "AWS::IAM::Role",
61+
"Properties": {
62+
"AssumeRolePolicyDocument": {
63+
"Statement": [
64+
{
65+
"Action": "sts:AssumeRole",
66+
"Effect": "Allow",
67+
"Principal": {
68+
"Service": "lambda.amazonaws.com"
69+
}
70+
}
71+
],
72+
"Version": "2012-10-17"
73+
},
74+
"ManagedPolicyArns": [
75+
{
76+
"Fn::Join": [
77+
"",
78+
[
79+
"arn:",
80+
{
81+
"Ref": "AWS::Partition"
82+
},
83+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
84+
]
85+
]
86+
}
87+
]
88+
}
89+
},
90+
"Python312SnapstartLambdaB0C15475": {
91+
"Type": "AWS::Lambda::Function",
92+
"Properties": {
93+
"Code": {
94+
"ZipFile": "pass"
95+
},
96+
"Handler": "Handler",
97+
"Role": {
98+
"Fn::GetAtt": [
99+
"Python312SnapstartLambdaServiceRole16F303C0",
100+
"Arn"
101+
]
102+
},
103+
"Runtime": "python3.12",
104+
"SnapStart": {
105+
"ApplyOn": "PublishedVersions"
106+
}
107+
},
108+
"DependsOn": [
109+
"Python312SnapstartLambdaServiceRole16F303C0"
110+
]
111+
},
112+
"Python313SnapstartLambdaServiceRoleC3989FBF": {
113+
"Type": "AWS::IAM::Role",
114+
"Properties": {
115+
"AssumeRolePolicyDocument": {
116+
"Statement": [
117+
{
118+
"Action": "sts:AssumeRole",
119+
"Effect": "Allow",
120+
"Principal": {
121+
"Service": "lambda.amazonaws.com"
122+
}
123+
}
124+
],
125+
"Version": "2012-10-17"
126+
},
127+
"ManagedPolicyArns": [
128+
{
129+
"Fn::Join": [
130+
"",
131+
[
132+
"arn:",
133+
{
134+
"Ref": "AWS::Partition"
135+
},
136+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
137+
]
138+
]
139+
}
140+
]
141+
}
142+
},
143+
"Python313SnapstartLambda008EE7A4": {
144+
"Type": "AWS::Lambda::Function",
145+
"Properties": {
146+
"Code": {
147+
"ZipFile": "pass"
148+
},
149+
"Handler": "Handler",
150+
"Role": {
151+
"Fn::GetAtt": [
152+
"Python313SnapstartLambdaServiceRoleC3989FBF",
153+
"Arn"
154+
]
155+
},
156+
"Runtime": "python3.13",
157+
"SnapStart": {
158+
"ApplyOn": "PublishedVersions"
159+
}
160+
},
161+
"DependsOn": [
162+
"Python313SnapstartLambdaServiceRoleC3989FBF"
163+
]
164+
},
165+
"DotnetSnapstartLambdaServiceRole222A9244": {
166+
"Type": "AWS::IAM::Role",
167+
"Properties": {
168+
"AssumeRolePolicyDocument": {
169+
"Statement": [
170+
{
171+
"Action": "sts:AssumeRole",
172+
"Effect": "Allow",
173+
"Principal": {
174+
"Service": "lambda.amazonaws.com"
175+
}
176+
}
177+
],
178+
"Version": "2012-10-17"
179+
},
180+
"ManagedPolicyArns": [
181+
{
182+
"Fn::Join": [
183+
"",
184+
[
185+
"arn:",
186+
{
187+
"Ref": "AWS::Partition"
188+
},
189+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
190+
]
191+
]
192+
}
193+
]
194+
}
195+
},
196+
"DotnetSnapstartLambda7DAEB52E": {
197+
"Type": "AWS::Lambda::Function",
198+
"Properties": {
199+
"Code": {
200+
"S3Bucket": {
201+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
202+
},
203+
"S3Key": "a328343cb12aa16bf2c12bfa98f28509923cf8a0e9771cccbbe967d9e15c08f6.zip"
204+
},
205+
"Handler": "Handler",
206+
"Role": {
207+
"Fn::GetAtt": [
208+
"DotnetSnapstartLambdaServiceRole222A9244",
209+
"Arn"
210+
]
211+
},
212+
"Runtime": "dotnet8",
213+
"SnapStart": {
214+
"ApplyOn": "PublishedVersions"
215+
}
216+
},
217+
"DependsOn": [
218+
"DotnetSnapstartLambdaServiceRole222A9244"
219+
]
220+
}
221+
},
222+
"Parameters": {
223+
"BootstrapVersion": {
224+
"Type": "AWS::SSM::Parameter::Value<String>",
225+
"Default": "/cdk-bootstrap/hnb659fds/version",
226+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
227+
}
228+
},
229+
"Rules": {
230+
"CheckBootstrapVersion": {
231+
"Assertions": [
232+
{
233+
"Assert": {
234+
"Fn::Not": [
235+
{
236+
"Fn::Contains": [
237+
[
238+
"1",
239+
"2",
240+
"3",
241+
"4",
242+
"5"
243+
],
244+
{
245+
"Ref": "BootstrapVersion"
246+
}
247+
]
248+
}
249+
]
250+
},
251+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
252+
}
253+
]
254+
}
255+
}
256+
}

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-snapstart.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
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/test/integ.lambda-snapstart.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
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/test/integ.lambda-snapstart.js.snapshot/lambdaruntimemanagementDefaultTestDeployAssertDE680AF3.assets.json

Lines changed: 19 additions & 0 deletions
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/test/integ.lambda-snapstart.js.snapshot/lambdaruntimemanagementDefaultTestDeployAssertDE680AF3.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)