From fdb0cf13c0b18a436c02a272626ce9f9dde9c343 Mon Sep 17 00:00:00 2001 From: Sean Myers Date: Tue, 21 Feb 2023 09:05:15 -0800 Subject: [PATCH] fix(lambda): RuntimeManagementMode.FUNCTION_UPDATE has wrong value (#24252) According to the Lambda docs, there is no space for FunctionUpdate. This commit uses the correct value, as specified here: https://docs.aws.amazon.com/lambda/latest/dg/API_PutRuntimeManagementConfig.html#API_PutRuntimeManagementConfig_RequestSyntax ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/aws-lambda/lib/runtime-management.ts | 2 +- packages/@aws-cdk/aws-lambda/test/runtime-management.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/lib/runtime-management.ts b/packages/@aws-cdk/aws-lambda/lib/runtime-management.ts index f83423ed11ae1..e5db1a679b462 100644 --- a/packages/@aws-cdk/aws-lambda/lib/runtime-management.ts +++ b/packages/@aws-cdk/aws-lambda/lib/runtime-management.ts @@ -16,7 +16,7 @@ export class RuntimeManagementMode { * With this mode, you can detect and mitigate rare runtime update incompatibilities early. * When using this mode, you must regularly update your functions to keep their runtime up to date. */ - public static readonly FUNCTION_UPDATE = new RuntimeManagementMode('Function update'); + public static readonly FUNCTION_UPDATE = new RuntimeManagementMode('FunctionUpdate'); /** * You specify a runtime version in your function configuration. * The function uses this runtime version indefinitely. diff --git a/packages/@aws-cdk/aws-lambda/test/runtime-management.test.ts b/packages/@aws-cdk/aws-lambda/test/runtime-management.test.ts index 1d0491f508755..62a294e9724c7 100644 --- a/packages/@aws-cdk/aws-lambda/test/runtime-management.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/runtime-management.test.ts @@ -20,7 +20,7 @@ describe('runtime', () => { }, }); }); - test('Runtime Management Function Update', () => { + test('Runtime Management FunctionUpdate', () => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app, 'stack'); @@ -33,7 +33,7 @@ describe('runtime', () => { // WHEN Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', { RuntimeManagementConfig: { - UpdateRuntimeOn: 'Function update', + UpdateRuntimeOn: 'FunctionUpdate', }, }); });