---
title: Lambda function should use the latest runtime environment version
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Lambda function should use the latest
  runtime environment version
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Lambda function should use the latest runtime environment version
 
## Description{% #description %}

AWS Lambda functions should run on the latest production runtime for their language, so that they receive current security patches, bug fixes, and features.

This rule passes a function that uses one of these runtimes: `nodejs26.x`, `python3.15`, `java25`, `dotnet10`, `ruby4.0`, or `provided.al2023`. A function that uses any other runtime fails. Preview runtimes are not in this list because AWS does not cover them under the Lambda SLA or AWS Support and advises against using them for production workloads.

**Note:** Lambda functions are deployed as either container images or .zip file archives. For a container image, the runtime is set when the base image is built and is not exposed in the function configuration. This rule skips functions with a `package_type` of `Image` and evaluates only functions with a `package_type` of `Zip`.

For the full list of runtimes, see [Lambda Event Function runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).

## Remediation{% #remediation %}

Change the function's runtime to one of the runtimes listed in the Description. Test the function code on the new runtime first, because AWS Lambda does not guarantee backward compatibility between major versions.

To change the runtime in the Lambda console:

1. Open the function and choose the **Code** tab.
1. In the **Runtime settings** section, choose **Edit**.
1. For **Runtime**, select the runtime identifier, and then choose **Save**.

See "Changing the runtime" in [Deploying Lambda Event Functions as .zip file archives](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-zip.html#configuration-function-runtime).

Alternatively, use the AWS CLI:

```shell
aws lambda update-function-configuration --function-name FUNCTION_NAME --runtime RUNTIME_IDENTIFIER
```

See [update-function-configuration](https://docs.aws.amazon.com/cli/latest/reference/lambda/update-function-configuration.html) in the AWS CLI Command Reference.
