(lambda): Deployment fails due to deprecated nodejs14.x runtime used in retention Lambdas #29312
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
Deploying a previously-working Python-based stack (cdk cli v2.130.0, aws-cdk.core package 1.204.0) fails with this error:
My stack does not include any NodeJS-based Lambdas, but the error seems to be coming from the creation of a Lambda function that manages log retention. My code sets a retention policy of "ONE_YEAR" on the logs generated by my own Python-based lambdas, but the selection of the now-deprecated nodejs14.x runtime for the log retention functions seems to be something built into the CDK templates.
Expected Behavior
Stack should have deployed successfully, using a non-deprecated runtime for Lambdas created outside the control of my own CDK code.
Current Behavior
Deployment fails and rolls back with this error:
11:09:58 AM | CREATE_FAILED | AWS::Lambda::Function | CustomS3AutoDelete...derHandler9D90184F
Resource handler returned message: "The runtime parameter of nodejs14.x is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs20.x) while creating or updating fun
ctions. (Service: Lambda, Status Code: 400, Request ID: f564c073-8071-45b0-a42e-cadae0894a78)" (RequestToken: 313b1028-5a92-5ee9-0639-543bd8462254, HandlerErrorCode: InvalidRequest)
Reproduction Steps
I'd think any stack that includes a log retention policy would run into this problem; will try to provide minimal example shortly.
Possible Solution
Specify nodejs20.x in built-in templates that generate Lambdas.
Additional Information/Context
No response
CDK CLI Version
2.130.0
Framework Version
No response
Node.js Version
20.5.1
OS
macOS 13.5.1
Language
Python
Language Version
Python (3.11.5)
Other information
No response
The text was updated successfully, but these errors were encountered: