Skip to content

Commit 52ef046

Browse files
authored
2 parents 837133c + 5ec536b commit 52ef046

File tree

6 files changed

+81
-2
lines changed

6 files changed

+81
-2
lines changed

CHANGELOG.v2.alpha.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.53.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.52.1-alpha.0...v2.53.0-alpha.0) (2022-11-29)
6+
57
## [2.52.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.52.0-alpha.0...v2.52.1-alpha.0) (2022-11-28)
68

79

CHANGELOG.v2.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.53.0](https://github.com/aws/aws-cdk/compare/v2.52.1...v2.53.0) (2022-11-29)
6+
7+
8+
### Features
9+
10+
* **lambda:** Add SnapStart resource spec patch ([4dda029](https://github.com/aws/aws-cdk/commit/4dda0295ac0ece271886609b140f71efebd3d22d))
11+
512
## [2.52.1](https://github.com/aws/aws-cdk/compare/v2.52.0...v2.52.1) (2022-11-28)
613

714

packages/@aws-cdk/aws-lambda/lib/function-hash.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export const VERSION_LOCKED: { [key: string]: boolean } = {
7474
PackageType: true,
7575
Role: true,
7676
Runtime: true,
77+
SnapStart: true,
7778
Timeout: true,
7879
TracingConfig: true,
7980
VpcConfig: true,

packages/@aws-cdk/aws-lambda/test/function.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,6 +3126,32 @@ test('function using a reserved environment variable', () => {
31263126
})).toThrow(/AWS_REGION environment variable is reserved/);
31273127
});
31283128

3129+
test('set SnapStart to desired value', () => {
3130+
const stack = new cdk.Stack();
3131+
new lambda.CfnFunction(stack, 'MyLambda', {
3132+
code: {
3133+
zipFile: 'java11-test-function.zip',
3134+
},
3135+
functionName: 'MyCDK-SnapStart-Function',
3136+
handler: 'example.Handler::handleRequest',
3137+
role: 'testRole',
3138+
runtime: 'java11',
3139+
snapStart: { applyOn: 'PublishedVersions' },
3140+
});
3141+
3142+
Template.fromStack(stack).hasResource('AWS::Lambda::Function', {
3143+
Properties:
3144+
{
3145+
Code: { ZipFile: 'java11-test-function.zip' },
3146+
Handler: 'example.Handler::handleRequest',
3147+
Runtime: 'java11',
3148+
SnapStart: {
3149+
ApplyOn: 'PublishedVersions',
3150+
},
3151+
},
3152+
});
3153+
});
3154+
31293155
function newTestLambda(scope: constructs.Construct) {
31303156
return new lambda.Function(scope, 'MyLambda', {
31313157
code: new lambda.InlineCode('foo'),
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"PropertyTypes": {
3+
"patch": {
4+
"description": "Properties for Lambda Function SnapStart",
5+
"operations": [
6+
{
7+
"op": "add",
8+
"path": "/AWS::Lambda::Function.SnapStart",
9+
"value": {
10+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html",
11+
"Properties": {
12+
"ApplyOn": {
13+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html#cfn-lambda-function-snapstart-applyon",
14+
"UpdateType" : "Mutable",
15+
"Required" : true,
16+
"PrimitiveType" : "String"
17+
}
18+
}
19+
}
20+
}
21+
]
22+
}
23+
},
24+
"ResourceTypes": {
25+
"AWS::Lambda::Function": {
26+
"patch": {
27+
"description": "Updates to Lambda Function to support SnapStart",
28+
"operations": [
29+
{
30+
"op": "add",
31+
"path": "/Properties/SnapStart",
32+
"value": {
33+
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-snapstart",
34+
"Required": false,
35+
"Type": "SnapStart",
36+
"UpdateType": "Mutable"
37+
}
38+
}
39+
]
40+
}
41+
}
42+
}
43+
}

version.v2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "2.52.1",
3-
"alphaVersion": "2.52.1-alpha.0"
2+
"version": "2.53.0",
3+
"alphaVersion": "2.53.0-alpha.0"
44
}

0 commit comments

Comments
 (0)