aws-cdk-lib.aws_lambda.RuntimeManagementMode

class RuntimeManagementMode

LanguageType name
.NETAmazon.CDK.AWS.Lambda.RuntimeManagementMode
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#RuntimeManagementMode
Javasoftware.amazon.awscdk.services.lambda.RuntimeManagementMode
Pythonaws_cdk.aws_lambda.RuntimeManagementMode
TypeScript (source)aws-cdk-lib » aws_lambda » RuntimeManagementMode

Specify the runtime update mode.

Example

new lambda.Function(this, 'Lambda', {
  runtimeManagementMode: lambda.RuntimeManagementMode.AUTO,
  runtime: lambda.Runtime.NODEJS_18_X,
  handler: 'index.handler',
  code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')),
});

Initializer (protected)

super(mode: string, arn?: string)

Parameters

  • mode string
  • arn string

Properties

NameTypeDescription
modestring
runtimeManagementConfigRuntimeManagementConfigPropertyhttps://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-runtimemanagementconfig.html.
arn?string
static AUTORuntimeManagementModeAutomatically update to the most recent and secure runtime version using Two-phase runtime version rollout.
static FUNCTION_UPDATERuntimeManagementModeWhen you update your function, Lambda updates the runtime of your function to the most recent and secure runtime version.

mode

Type: string


runtimeManagementConfig

Type: RuntimeManagementConfigProperty

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-runtimemanagementconfig.html.


arn?

Type: string (optional)


static AUTO

Type: RuntimeManagementMode

Automatically update to the most recent and secure runtime version using Two-phase runtime version rollout.

We recommend this mode for most customers so that you always benefit from runtime updates.


static FUNCTION_UPDATE

Type: RuntimeManagementMode

When you update your function, Lambda updates the runtime of your function to the most recent and secure runtime version.

This approach synchronizes runtime updates with function deployments, giving you control over when Lambda applies runtime updates. 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.

Methods

NameDescription
static manual(arn)You specify a runtime version in your function configuration.

static manual(arn)

public static manual(arn: string): RuntimeManagementMode

Parameters

  • arn string

Returns

  • RuntimeManagementMode

You specify a runtime version in your function configuration.

The function uses this runtime version indefinitely. In the rare case in which a new runtime version is incompatible with an existing function, you can use this mode to roll back your function to an earlier runtime version.