Skip to content

Commit

Permalink
chore(merge-back): 2.53.0 (aws#23137)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Nov 29, 2022
2 parents 837133c + 5ec536b commit 52ef046
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.v2.alpha.md
Expand Up @@ -2,6 +2,8 @@

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.

## [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)

## [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)


Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.v2.md
Expand Up @@ -2,6 +2,13 @@

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.

## [2.53.0](https://github.com/aws/aws-cdk/compare/v2.52.1...v2.53.0) (2022-11-29)


### Features

* **lambda:** Add SnapStart resource spec patch ([4dda029](https://github.com/aws/aws-cdk/commit/4dda0295ac0ece271886609b140f71efebd3d22d))

## [2.52.1](https://github.com/aws/aws-cdk/compare/v2.52.0...v2.52.1) (2022-11-28)


Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda/lib/function-hash.ts
Expand Up @@ -74,6 +74,7 @@ export const VERSION_LOCKED: { [key: string]: boolean } = {
PackageType: true,
Role: true,
Runtime: true,
SnapStart: true,
Timeout: true,
TracingConfig: true,
VpcConfig: true,
Expand Down
26 changes: 26 additions & 0 deletions packages/@aws-cdk/aws-lambda/test/function.test.ts
Expand Up @@ -3126,6 +3126,32 @@ test('function using a reserved environment variable', () => {
})).toThrow(/AWS_REGION environment variable is reserved/);
});

test('set SnapStart to desired value', () => {
const stack = new cdk.Stack();
new lambda.CfnFunction(stack, 'MyLambda', {
code: {
zipFile: 'java11-test-function.zip',
},
functionName: 'MyCDK-SnapStart-Function',
handler: 'example.Handler::handleRequest',
role: 'testRole',
runtime: 'java11',
snapStart: { applyOn: 'PublishedVersions' },
});

Template.fromStack(stack).hasResource('AWS::Lambda::Function', {
Properties:
{
Code: { ZipFile: 'java11-test-function.zip' },
Handler: 'example.Handler::handleRequest',
Runtime: 'java11',
SnapStart: {
ApplyOn: 'PublishedVersions',
},
},
});
});

function newTestLambda(scope: constructs.Construct) {
return new lambda.Function(scope, 'MyLambda', {
code: new lambda.InlineCode('foo'),
Expand Down
@@ -0,0 +1,43 @@
{
"PropertyTypes": {
"patch": {
"description": "Properties for Lambda Function SnapStart",
"operations": [
{
"op": "add",
"path": "/AWS::Lambda::Function.SnapStart",
"value": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html",
"Properties": {
"ApplyOn": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-snapstart.html#cfn-lambda-function-snapstart-applyon",
"UpdateType" : "Mutable",
"Required" : true,
"PrimitiveType" : "String"
}
}
}
}
]
}
},
"ResourceTypes": {
"AWS::Lambda::Function": {
"patch": {
"description": "Updates to Lambda Function to support SnapStart",
"operations": [
{
"op": "add",
"path": "/Properties/SnapStart",
"value": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-snapstart",
"Required": false,
"Type": "SnapStart",
"UpdateType": "Mutable"
}
}
]
}
}
}
}
4 changes: 2 additions & 2 deletions version.v2.json
@@ -1,4 +1,4 @@
{
"version": "2.52.1",
"alphaVersion": "2.52.1-alpha.0"
"version": "2.53.0",
"alphaVersion": "2.53.0-alpha.0"
}

0 comments on commit 52ef046

Please sign in to comment.