-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(custom-resource): AwsCustomResource supports AWS SDK for JavaScript v3 #25406
feat(custom-resource): AwsCustomResource supports AWS SDK for JavaScript v3 #25406
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
…at/aws-custom-resource/support-aws-sdk-v3
…/github.com/WinterYukky/aws-cdk into feat/aws-custom-resource/support-aws-sdk-v3
Oh wow! I was about to start working on migrating us over to V3 so I'm SO excited to see this contribution! |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
…at/aws-custom-resource/support-aws-sdk-v3
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.
This is some great stuff!
I have been working on making the default custom resource runtime Node18 and AwsCustomResource
is definitely the hard part. This solves my biggest concern in backwards compatibility. I have been investigating how to dynamically create the service list and map v2 to v3 service names, but we can do that in a follow up PR if we can figure out a way to do it reliably.
Since this allows for backwards compatibility, I think we should merge it (a couple of small changes requested), then enable Node 18 as the default CR runtime behind a feature flag separately.
.../framework-integ/test/custom-resources/test/aws-custom-resource/integ.aws-custom-resource.ts
Show resolved
Hide resolved
Co-authored-by: Mitchell Valine <mitchellvaline@gmail.com>
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
What changes
Add support of AWS SDK for JavaScript v3 to
⚠️ This PR only add support, doesn' change custom resource default runtime version
AwsCustomResource
. It also continues to works with runtimes that use the AWS SDK for JavaScript v2 (e.g Node.js 16.x).Why need this change?
Because AWS SDK for JavaScript v2 enters into maintenance mode in 2023.
At least, we must upgrade Node.js runtime to 18 or higher version that using AWS SDK for JavaScript v3 in 2023. If not upgrade, when customers possibly can't use new AWS Service's APIs.
※ reference from Document for AWS SDK for JavaScript v2
Why don't change default runtime version?
AWS Lambda uses AWS SDK for JavaScript v3 since Node.js 18.x runtime. This is major update so I think it has breaking changes. This is reason. So I plan this.
AwsCustomResource
's default runtime to Node.js 18.x in 2023 or Node.js 16.x EOLThis plan allows time for transition before changing the default runtime for
AwsCustomResource
.Are there any changes to the props?
Yes. The specification method for the AWS SDK for JavaScript v3 will now be supported.
In AWS SDK for JavaScript v3, packages are installed for each service. Therefore, specify the package name for
service
. Also,action
specifies the XxxClient operations provided in the package.Example of SSM.getParameter:
What actions do customers need to take when migrating?
Nothing to do. To maintain backward compatibility, when customers provides AWS SDK for JavaScript v2 style parameters, then
AwsCustomResource
automatically convert the parameters to AWS SDK for JavaScript v3 style and handle it in lambda runtime code. Next example will be allowed.How can I use it before the default runtime changes?
Overriding with
regioninfo.Fact.register
or rewriting it likeaddPropertyOverride
by customers. There are currently no plans to provide dedicated functions.This example is pattern of using regioninfo.Fact.register.
AwsCustomResource
will experimentally supports AWS SDK for JavaScript v3 (NODEJS_18_X or higher) by this PR. In AWS SDK for JavaScript v3, packages are installed for each service. Therefore, specify the package name forservice
. Also,action
specifies the XxxClient operations provided in the package. This example is the same asSSM.getParameter
in v2.Others
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license