aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.5k stars 3.84k forks source link

SDKv3-07: Update remaining parts of `aws-cdk` #29838

Open TheRealAmazonKendra opened 4 months ago

TheRealAmazonKendra commented 4 months ago

Context

The AWS SDK V2 is being deprecated. We need to remove all uses of it from the CDK.

Task Description

This is the grab bag task to find all remaining uses of sdkv2 in aws-cdk and remove them.

Acceptance Criteria

  1. No uses of sdkv2 remain in aws-cdk
  2. All tests (unit and integ) pass post change.
kuhe commented 2 months ago

One of the remaining usages is https://github.com/search?q=repo%3Aaws%2Faws-cdk%20getEndpointSuffix&type=code the getEndpointSuffix function, which is private in the AWS SDK for JavaScript (v2) and shouldn't be used.

Getting an endpoint suffix from only a region isn't really something supported by the public API of the AWS SDK. Consult internally with the AWS SDK for JavaScript team if you would like to work out how to resolve endpoints.

In the AWS SDK specification, an endpoint, and therefore including the suffix as well, cannot be accurately resolved without knowing the service, operation, region, and potentially several more parameters. An AWS service is free to send different operations to entirely arbitrary endpoints based on parameters to that particular invocation, so having only the region is not sufficient.

Garethp commented 1 month ago

One of the other remaining usages is in the SDK Usages of Credential Providers. The current usage forces credential providers to wrap their credentials in AWS.Credentials from aws-sdk v2 as there's no class/interface in v3 that matches this interface