Lambda function should use the latest runtime environment version

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

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.

Note: AWS Lambda supports both container images and .zip file archives for the deployment package. When using an Image, the runtime is not accessible in the configuration data, as it is defined at the time of base image creation. This remains consistent across all three types of base images, AWS, and Custom. As a result, this configuration check only reports findings against Zip type deployment packages.

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"
  

nodejs18.x

update-function-configuration.sh

  aws lambda update-function-configuration
    --function-name YourLambdaFunction
    --runtime "nodejs18.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"