<  Back to rules search

Lambda function uses latest runtime environment version

lambda
Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Description

Update your Amazon Lambda Function to the latest runtime environment version.

Rationale

As a best practice, Amazon recommends consistently updating your runtime environment to the latest version for security patches, bug fixes, and the latest features.

Remediation

From the console

Follow the Configuring functions in the console docs to learn how to update the Lambda runtime that runs your function.

From the command line

  1. Run update-function-configuration with your function name and the latest runtime version supported by AWS.

python3.9

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "python3.9"
  

nodejs16.x

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "nodejs14.x"
  

java11

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "java11"
  

go1.x

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "go1.x"
  

dotnet6

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "dotnet6"
  

ruby2.7

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "ruby2.7"
  

provided.al2

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "provided.al2"