Closed matheushent closed 2 years ago
same issue. Is there a solution here?
@matheushent @s1mrankaur
In #21148 the Python version for aws-s3-deployment
was upgraded from 3.7 to 3.9.
Are using the latest version of AWS CDK in your project? I think your CDK CLI version is up-to-date. Did you also check the CDK version in your project (package.json
in Typescript, requirements.txt
in Python)?
Maybe the version 3.6 issue is related to outdated dependencies because the latest PR changes version 3.7 to 3.9. Therefore I would expect minimum version 3.7 in the Lambda handler.
CC @kaizencc
@jumic indeed, it seems I do have the CLI up to date but not the packages, that's the problem
Indeed, missing to upgrade the packages was the problem for me. I shall solve since my issue is fixed.
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.
@matheushent
This is what I have in package.json . I upgraded cdk already. Do I also need to update @aws-cdk/aws-s3 ?
"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"
}
}
@s1mrankaur the missing piece you have (the same as I had) is you don't need to define the 1.x packages. Just defining aws-cdk 2.35.0 should work
@matheushent Thanks for your response. I have these imports everywhere for all of the modules.
import * as s3deploy from '@aws-cdk/aws-s3-deployment';
What should these be replaced with?
@s1mrankaur There is a migration guide that describes the steps: https://docs.aws.amazon.com/cdk/v2/guide/migrating-v2.html#migrating-v2-v1-uppgrade Search for "Change your imports to import" on this page, there you will find an example.
import { aws_s3_deployment as s3deploy } from 'aws-cdk-lib';
Describe the bug
Basically what happens is the class
BucketDeployment
from theaws-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: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
The following python code reproduces the bug. Note that, when listing, synthing and deploying, CloudFormation won't point out any error. In fact, is Lambda that indicates the error when the stack is deployed.
The snippet above was teste in both CDK versions: v1 and v2.
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
16.15.1
OS
macOS Monterey 12.5
Language
Python
Language Version
Python (3.9.13)
Other information
No response