aws-cdk
aws-cdk copied to clipboard
(aws-s3-deployment): BucketDeployment creates Lambda function with unsupported runtime
Describe the bug
Basically what happens is the class BucketDeployment from the aws-s3-deployment creates a Lambda function (a child in this case) which has as its runtime Python 3.6 but Lambda doesn't support this version anymore. So, when deploying the stack, CloudFormation raises the following error:
Resource handler returned message: "The runtime parameter of python3.6 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (python3.9) while creating or updating functions. The problem is also the fact I cannot set the runtime I want to neither in CDK v1 nor CDK v2.
Expected Behavior
I'd expect CDK to set a supported Runtime by Lambda
Current Behavior
CDK is setting Python 3.6 as default runtime and not allowing me to specify another runtime
Reproduction Steps
Deploy a stack from https://github.com/awslabs/aws-simple-cicd . It will fail reporting the version issue
Possible Solution
A possible solutions is to allow the runtime specification in the BucketDeployment class. Another solution (not the one I prefer) is to hardcode the runtime as it currently is but use one supported instead.
Additional Information/Context
No response
CDK CLI Version
2.35.0
Framework Version
No response
Node.js Version
14.8.0
OS
Windows
Language
Typescript, Python
Language Version
No response
Other information
No response
@otaviomacedo This should be already resolved. See discussion in #21467.
@jumic Thanks for linking. I already updated cdk in packagej.json
"devDependencies": { "@aws-cdk/aws-codebuild": "1.119.0", "@aws-cdk/aws-codecommit": "1.119.0", "@aws-cdk/aws-codepipeline": "1.119.0", "@aws-cdk/aws-codepipeline-actions": "1.119.0", "@aws-cdk/aws-ec2": "1.119.0", "@aws-cdk/aws-ecr": "^1.119.0", "@aws-cdk/aws-events-targets": "1.119.0", "@aws-cdk/aws-iam": "1.119.0", "@aws-cdk/aws-lambda": "1.119.0", "@aws-cdk/aws-s3": "1.119.0", "@aws-cdk/aws-sns": "1.119.0", "@aws-cdk/aws-sns-subscriptions": "1.119.0", "@aws-cdk/core": "1.119.0", "@types/node": "15.6.1", "aws-cdk": "2.35.0", "aws-sdk": "^2.792.0", "husky": "^4.3.0", "ts-node": "^10.3.0", "tsort": "0.0.1", "typescript": "^4.0.5" }, "dependencies": { "@aws-cdk/aws-s3-deployment": "1.119.0", "@aws-cdk/aws-secretsmanager": "1.119.0", "@aws-cdk/aws-ssm": "1.119.0", "@aws-cdk/cloudformation-diff": "^1.119.0", "cdk-assets": "^1.124.0", "source-map-support": "^0.5.19" } }
Still running into this issue though.
@s1mrankaur have you tried with version 2?
@otaviomacedo Ended up upgrading individual packages to 1.167.0 and that worked
Closing this since it's been resolved
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hello @s1mrankaur can you please share your final version of package.json to confirm the changes? I tried the mentioned solution, but it didn't work for me.
Same Here. I tried the mentioned solution, but it didn't work for me. @s1mrankaur Please share your final version of package.json
@sunilksahoo @klebertertulino
Upgrading @aws-cdk/aws-s3-deployment to 1.167.0 fixed the issue.
"devDependencies": { "@aws-cdk/aws-codebuild": "1.167.0", "@aws-cdk/aws-codecommit": "1.167.0", "@aws-cdk/aws-codepipeline": "1.167.0", "@aws-cdk/aws-codepipeline-actions": "1.167.0", "@aws-cdk/aws-ec2": "1.167.0", "@aws-cdk/aws-ecr": "^1.167.0", "@aws-cdk/aws-events-targets": "1.167.0", "@aws-cdk/aws-iam": "1.167.0", "@aws-cdk/aws-lambda": "1.167.0", "@aws-cdk/aws-s3": "1.167.0", "@aws-cdk/aws-sns": "1.167.0", "@aws-cdk/aws-sns-subscriptions": "1.167.0", "@aws-cdk/core": "1.167.0", "@types/node": "15.6.1", "aws-cdk": "^2.35.0", "aws-sdk": "^2.792.0", "husky": "^4.3.0", "ts-node": "^10.3.0", "tsort": "0.0.1", "typescript": "^4.0.5" }, "dependencies": { "@aws-cdk/aws-s3-deployment": "1.167.0", "@aws-cdk/aws-secretsmanager": "1.167.0", "@aws-cdk/aws-ssm": "1.167.0", "@aws-cdk/cloudformation-diff": "^1.167.0", "cdk-assets": "^1.124.0", "source-map-support": "^0.5.19" }