-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s3: Custom s3 auto delete lambda is still using node 20.x #33622
Comments
Hi @yaseen104, Thank you for reporting this issue. You're correct that the CustomS3AutoDelete Lambda function is still using Node.js 20.x despite Node.js 22.x being a supported runtime in AWS CDK since version 2.168.0. After investigating, I can explain why this is happening:
aws-cdk/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts Lines 111 to 119 in f44209e
This behavior is by design rather than a bug. AWS CDK is being cautious about updating the "latest" runtime designation to ensure consistent behavior across all regions. Once Node.js 22.x becomes available in all regions, the CDK team will likely update the I'll bring this issue up to the team to review and re-evaluate if it's OK to bump the latest to node22. |
related to #27003 (comment) |
As Pahud says and is as intended and tracked in #27003 we are currently using Node 20 in commercial regions for custom resources. For lambdas you author you can use NODEJS_22_X \for the runtime. I will close this in favour of the tracking issue. |
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
After
2.168.0
there was a support for node 22.x.Below is the code
const s3BucketWeb = new s3.Bucket(stack,
${envProps.environmentName}-s3-web, { // Block all public access blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL, // When stack is deleted, delete this bucket also removalPolicy: cdk.RemovalPolicy.DESTROY, // Delete contained objects when bucket is deleted autoDeleteObjects: true });
But the CustomS3AutoDelete Lambda is till taking the node 20.x
Tried the version till
2.180.0
.Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The node version should be updated to 22.
Current Behavior
It is still taking node 20
Reproduction Steps
const s3BucketWeb = new s3.Bucket(stack,
${envProps.environmentName}-s3-web, { // Block all public access blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL, // When stack is deleted, delete this bucket also removalPolicy: cdk.RemovalPolicy.DESTROY, // Delete contained objects when bucket is deleted autoDeleteObjects: true });
Using this code, this will create the auto delete objects
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.170.0
Framework Version
No response
Node.js Version
20
OS
windows
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: