Managed Lambda runtimes for .zip file archives are built around a combination of operating system, programming language, and software libraries that are subject to maintenance and security updates. When security updates are no longer available for a component of a runtime, Lambda deprecates the runtime.
Info
This rule is implemented natively in cfn-lint as rule number E2531.
import{Code,Function,Runtime}from'@aws-cdk/aws-lambda';exportclassMyStackextendscdk.Stack{constructor(scope: cdk.Construct,id: string,props?: cdk.StackProps){super(scope,id,props);constmyFunction=newFunction(scope,'MyFunction',{code: Code.fromAsset('src/hello/'),handler:'main.handler',// Select a runtime that is not deprecatedruntime: Runtime.PYTHON_3_8,});}}
Resources:MyFunction:Type:AWS::Serverless::FunctionProperties:CodeUri:.# Select a runtime that is not deprecatedRuntime:python3.8Handler:main.handler
12345678
provider:name:aws# Select a runtime that is not deprecatedruntime:nodejs14.xfunctions:hello:handler:handler.hello
1234567
resource"aws_lambda_function""this"{function_name="my-function" # Select a runtime that is not deprecatedruntime="python3.8"handler="main.handler"filename="function.zip"}