-
Notifications
You must be signed in to change notification settings - Fork 730
refactor(core): migrate various clients from aws-sdk v2 to v3 pt2 #8175
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
refactor(core): migrate various clients from aws-sdk v2 to v3 pt2 #8175
Conversation
|
d92f77c to
24f0a05
Compare
| private static readonly metadataServiceTimeout: number = 500 | ||
| // AWS EC2 Instance Metadata Service (IMDS) constants | ||
| // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-metadata-v2-how-it-works.html | ||
| private static readonly metadataServiceHost: string = '169.254.169.254' |
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.
should this be hardcoded?
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.
v2 had an abstraction layer and would use these values internally:
- https://github.com/aws/aws-sdk-js/blob/f5b1a6f0aebb477204d979091d654649f29ad9ce/lib/metadata_service/get_endpoint.js#L3
- https://github.com/aws/aws-sdk-js/blob/f5b1a6f0aebb477204d979091d654649f29ad9ce/lib/metadata_service.js#L130
v3 removed the abstraction layer, so v3 uses Smithy's httpRequest() which requires us to specify the host and path
169.254.169.254is the official AWS-defined IP for EC2 Instance Metadata Service (IMDS) as per: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html#instance-metadata-v2-how-it-works
24f0a05 to
165e3af
Compare
## Note **There is still a little bit more work needed for fully migrating aws-sdk v2 to v3, specifically all of these clients [here](https://github.com/aws/aws-toolkit-vscode/blob/59fd17fcfa22798e78d0df196290edb4a070f7ec/packages/core/scripts/build/generateServiceClient.ts#L232-L251) from the `generateServiceClient.ts` script** ## Problem AWS SDK V2 is at EOL ## Solution Migrate AWS SDK V2 to V3 This work has been done in the `feature/v2-to-v3-migration` feature branch and thus merging it into `master` Here are the PRs, which this does not include the merges from main and resolving conflicts: - #8043 - #8042 - #8046 - #8054 - #8041 - #8056 - #8081 - #8069 - #8067 - #8093 - #8095 - #8094 - #8171 - #8159 - #8175 - #8182 ## Testing Manually tested the [prerelease builds](https://github.com/aws/aws-toolkit-vscode/releases/tag/pre-v2-to-v3-migration) https://github.com/user-attachments/assets/b1d4795c-4027-462e-a195-509ac4a9d8ae --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: aws-toolkit-automation <[email protected]> Co-authored-by: Tai Lai <[email protected]> Co-authored-by: invictus <[email protected]> Co-authored-by: Laxman Reddy <[email protected]>
Problem
AWS SDK V2 is at EOL. All client should migrate to V3.
Solution
More work has been done to migrate these clients:
feature/xbranches will not be squash-merged at release time.