-
Notifications
You must be signed in to change notification settings - Fork 36
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
fix: update default runtime to support CDK < 2.105.0 #497
Conversation
.projenrc.ts
Outdated
@@ -26,8 +26,6 @@ const project = new CdklabsConstructLibrary({ | |||
'hpagent', | |||
], | |||
deps: [ | |||
'aws-cdk-lib@^2.0.0', | |||
'constructs@^10.0.5', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need to specify this. It's controlled by the upstream projen config and the peerDependencies
it produces. In fact, this caused problems for me because yarn
used a newer aws-cdk-lib version than what's specified in your peer deps.
cc @SamStephens @fabiozig @scanlonp , who authored/approved #424 |
Runtime.PROVIDED_AL2023
Alternatively, you could It still probably makes sense to spot-check your code and have a more specific minimum version, still, though. |
I also had the same problem and I had to change the version manually in my projects. I also agree with changing the dependency to peerDependencies, and devDependencies only. Even cdk documentation suggests this approach:
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib-readme.html Could this be a breaking change in case the dependencies are removed? |
I reckon we should keep everything else as it is and change the default to |
Head branch was pushed to by a user without write access
e1adc15
to
fb16893
Compare
Runtime.PROVIDED_AL2023
Sounds good @mrgrain - I updated this PR as requested. |
fb16893
to
75195dd
Compare
As of version 3.x, this project now uses the
Runtime.PROVIDED_AL2023
runtime. However, this enumerated value does not exist in older versions of aws-cdk, prior to[email protected]
. If you use a version older than that, you get this cryptic error:Therefore, we're not using the static version, instead
new
-ing it up: https://github.com/aws/aws-cdk/blob/b49032b3a6e549783b45492ffc76880fbcd58e68/packages/aws-cdk-lib/aws-lambda/lib/runtime.ts#L300-L303