From 39755fd85487814d2276a2730f3d2f1eb97d5150 Mon Sep 17 00:00:00 2001 From: Colin Francis <131073567+colifran@users.noreply.github.com> Date: Wed, 17 Apr 2024 05:06:09 -0700 Subject: [PATCH] chore: update name of `sdk-v2-to-v3-adapter` and improve documentation (#29847) ### Issue # (if applicable) Closes #29843 ### Reason for this change The AWS SDK V2 is being deprecated. The `sdk-v2-to-v3-adapter` was created as a way to migrate `AwsCustomResource` to use AWS SDK V3 without introducing breaking changes. The documentation for the adapter does not provide enough detail about what it is used for and what functionality it provides. Additionally, the naming of the adapter should convey that it is used to provide an abstraction over all SDK versions, not just SDK V2 to SDK V3. ### Description of changes The `sdk-v2-to-v3-adapter` was changed to `aws-custom-resource-sdk-adapter`. Any usage of `sdk-v2-to-v3-adapter` was updated to now use `aws-custom-resource-sdk-adapter`. The `README` for `aws-custom-resource-sdk-adapter` was improved to provide an overview of the tooling that exists as part of the adapter. ### Description of how you validated changes No new unit tests or integ tests were needed as part of this PR. The current build is succeeding which means that the naming update has not introduced a breaking change. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- aws-cdk.code-workspace | 4 +- .../.eslintrc.js | 0 .../.gitignore | 0 .../.npmignore | 0 .../LICENSE | 0 .../NOTICE | 0 .../aws-custom-resource-sdk-adapter/README.md | 94 +++++++++++++++++++ .../jest.config.js | 0 .../lib/api-call.ts | 0 .../lib/coerce-api-parameters.ts | 0 .../lib/find-client-constructor.ts | 0 .../lib/index.ts | 0 .../lib/parameter-types.ts | 0 .../lib/sdk-info.ts | 0 .../lib/sdk-v2-to-v3.json | 0 .../lib/sdk-v3-metadata.json | 0 .../package.json | 6 +- .../test/api-call.test.ts | 0 .../test/coerce-api-parameters.test.ts | 0 .../test/flatten.test.ts | 0 .../tsconfig.json | 2 +- .../aws-api-handler/index.ts | 2 +- .../aws-sdk-v2-handler.ts | 2 +- .../aws-sdk-v3-handler.ts | 2 +- .../custom-resource-handlers/package.json | 2 +- .../providers/lambda-handler/sdk.ts | 2 +- .../@aws-cdk/integ-tests-alpha/package.json | 2 +- .../@aws-cdk/sdk-v2-to-v3-adapter/README.md | 3 - packages/aws-cdk-lib/package.json | 2 +- scripts/update-sdkv3-parameters-model.ts | 6 +- 30 files changed, 110 insertions(+), 19 deletions(-) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/.eslintrc.js (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/.gitignore (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/.npmignore (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/LICENSE (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/NOTICE (100%) create mode 100644 packages/@aws-cdk/aws-custom-resource-sdk-adapter/README.md rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/jest.config.js (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/api-call.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/coerce-api-parameters.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/find-client-constructor.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/index.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/parameter-types.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/sdk-info.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/sdk-v2-to-v3.json (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/lib/sdk-v3-metadata.json (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/package.json (89%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/test/api-call.test.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/test/coerce-api-parameters.test.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/test/flatten.test.ts (100%) rename packages/@aws-cdk/{sdk-v2-to-v3-adapter => aws-custom-resource-sdk-adapter}/tsconfig.json (94%) delete mode 100644 packages/@aws-cdk/sdk-v2-to-v3-adapter/README.md diff --git a/aws-cdk.code-workspace b/aws-cdk.code-workspace index a5f31caba18b9..db36117c4c910 100644 --- a/aws-cdk.code-workspace +++ b/aws-cdk.code-workspace @@ -27,8 +27,8 @@ "rootPath": "packages/@aws-cdk/integ-tests-alpha" }, { - "name": "sdk-v2-to-v3-adapter", - "rootPath": "packages/@aws-cdk/sdk-v2-to-v3-adapter" + "name": "aws-custom-resource-sdk-adapter", + "rootPath": "packages/@aws-cdk/aws-custom-resource-sdk-adapter" } ] }, diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/.eslintrc.js b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/.eslintrc.js similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/.eslintrc.js rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/.eslintrc.js diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/.gitignore b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/.gitignore similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/.gitignore rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/.gitignore diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/.npmignore b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/.npmignore similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/.npmignore rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/.npmignore diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/LICENSE b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/LICENSE similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/LICENSE rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/LICENSE diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/NOTICE b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/NOTICE similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/NOTICE rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/NOTICE diff --git a/packages/@aws-cdk/aws-custom-resource-sdk-adapter/README.md b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/README.md new file mode 100644 index 0000000000000..6850c070a6f53 --- /dev/null +++ b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/README.md @@ -0,0 +1,94 @@ +# AWS Custom Resource SDK Adapter + +The AWS custom resource SDK adapter is an internal collection of tools built to maintain compatibility with the contracts defined for `AwsCustomResource` and the current AWS SDK version. `AwsCustomResource` can be used where a single API call can fill a gap in CloudFormation coverage by allowing a user to specify a single API call specific to create, update, and delete stack events. Users specify a `service`, an `action`, and `parameters` as part of the `AwsSdkCall` interface which are used to dynamically invoke the API. Since `AwsCustomResource` was created while SDKv2 was active, it implicitly inherited the SDKv2 contract. As a result, migrating to newer SDK versions will result in breaking changes in the `AwsCustomResource` construct. In its current state, the AWS custom resource SDK adapter contains tooling that allows `AwsCustomResource` to make API calls using SDKv3 and return the associated response. These tools are related to: + +* Input type coercion +* Response coercion +* Naming normalizaion + +## Input Type Coercion + +In general, input types expected by SDKv3 are more restrictive than what was expected by SDKv2. One such example is the regression to number types with respect to AWS SDKv2. More specifically, in SDKv2, number types that are accidentally passed as strings will be silently converted to the right type. SDKv3, however, will not do the conversion which causes the server call to fail because of mismatched types. For example, + +**SDKv2** + +```ts +const codedeploy = new AWS.CodeDeploy({ region: 'eu-west-1' }); + +const input: AWS.CodeDeploy.CreateDeploymentConfigInput = { + deploymentConfigName: 'testtest', + computePlatform: 'Lambda', + trafficRoutingConfig: { + type: "TimeBasedLinear", + timeBasedLinear: { + linearInterval: "1" as any, // The type says 'number' but we're forcing strings here + linearPercentage:"5" as any, + }, + }, +}; + +// Following call happily succeeds +console.log(await codedeploy.createDeploymentConfig(input).promise()); +``` + +**SDKv3** + +```ts +const codedeploy = new CodeDeploy(); + +const input: CreateDeploymentConfigCommandInput = { + deploymentConfigName: 'testtest', + computePlatform: 'Lambda', + trafficRoutingConfig: { + type: "TimeBasedLinear", + timeBasedLinear: { + linearInterval: "1" as any, // The type says 'number' but we're forcing strings here + linearPercentage:"5" as any, + }, + }, +}; + +await codedeploy.createDeploymentConfig(input); + +// The above call fails with the following message: +'SerializationException: STRING_VALUE can not be converted to an Integer' +``` + +Another example is the regression to blob types with respect to SDKv2. More specifically, in SDKv2, input fields marked as blob types used to permissively accept strings, buffers, and uint8arrays. In SDKv3, these same fields now only accept uint8arrays. + +In response, the [`Coercer`](./lib/coerce-api-parameters.ts) class was created to coerce input parameters to the type expected by SDKv3. At a high-level, this class coerces parameter types using a state-machine generated using smithy models. The state-machine is gzipped to save bytes and the gzipped representation can be seen [here](./lib/parameter-types.ts). + +## Response Coercion + +In some cases, API call responses for SDKv3 differ from API call responses for SDKv2. One example is streaming vs. buffered responses. More specifically, SDKv3 prefers not to buffer potentially large responses. For node.js, you must consume the stream or garbage collect the client or its request handler to keep the connection open to new traffic by freeing sockets. For example, + +**SDKv2** + +```ts +// this buffers (consumes) the stream already +const get = await s3.getObject({ ... }).promise(); +``` + +**SDKv3** + +```ts +// consume the stream to free the socket +const get = await s3.getObject({ ... }); // object .Body has unconsumed stream +const str = await get.Body.transformToString(); // consumes the stream +``` + +Users are able to retrieve values returned as a result of API calls they’ve defined while using the `AwsCustomResource` construct. To be retrievable, the response values must be strings. With SDKv3, the stream must be fully consumed to a string before the custom resource exits. Thus, response coercion was built as another tool in the AWS custom resource SDK adapter. Return type coercion exists in the [api-call](./lib/api-call.ts) file and the logic is implemented in the `coerceSdkv3Response` function. + +## Naming Normalization + +Originally, the `AwsCustomResource` construct advertised that the `service` argument defined in the `AwsSdkCall` interface could be in any one of the following formats: + +* The SDK v2 constructor name: APIGateway +* The SDK v2 constructor name in all lower case: apigateway (primary format) + +Similarly, the `action` argument defined in the `AwsSdkCall` interface was advertised as being permitted in any of the following formats: + +* The API call name: GetRestApi +* The API call name with a lower case starting letter: getRestApi (primary format) + +Migrating `AwsCustomResource` to SDKv3 meant that the permitted `service` and `action` values for SDKv2 needed to be accepted as well as new formats with respect to SDKv3. As a result, naming normalization was established as a way to convert the `service` and `action` arguments into the format expected for SDKv3 API calls. The normalization functions for `service` and `action` can be seen in the [sdk-info](./lib/sdk-info.ts) file and are named `normalizeServiceName` and `normalizeActionName`, respectively. To enable normalization of the `service` argument, the client package names map file from the `aws-sdk-js-codemod` repository is used and can be found [here](./lib/sdk-v2-to-v3.json). More specifically, this file is used to map SDKv2 `service` names to the equivalent SDKv3 `service` name. To enable normalization of the `action` argument a [sdk-v3-metadata](./lib/sdk-v3-metadata.json) file was extracted which contains a list of APIs that end in the word `Command` which allows us to disambiguate around these when generating the SDKv3 `action` name. Note that the [sdk-v3-metadata](./lib/sdk-v3-metadata.json) file also contains a mapping of `service` names into an IAM name allowing us to correctly identify the IAM prefix for each `service`. diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/jest.config.js b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/jest.config.js similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/jest.config.js rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/jest.config.js diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/api-call.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/api-call.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/api-call.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/api-call.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/coerce-api-parameters.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/coerce-api-parameters.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/coerce-api-parameters.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/coerce-api-parameters.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/find-client-constructor.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/find-client-constructor.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/find-client-constructor.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/index.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/index.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/index.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/index.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/parameter-types.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/parameter-types.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/parameter-types.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/parameter-types.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-info.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-info.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-info.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-info.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v2-to-v3.json b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v2-to-v3.json similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v2-to-v3.json rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v2-to-v3.json diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v3-metadata.json b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v3-metadata.json similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v3-metadata.json rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v3-metadata.json diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/package.json b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/package.json similarity index 89% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/package.json rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/package.json index cf8756f303318..a8ab7389aab0d 100644 --- a/packages/@aws-cdk/sdk-v2-to-v3-adapter/package.json +++ b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/package.json @@ -1,6 +1,6 @@ { - "name": "@aws-cdk/sdk-v2-to-v3-adapter", - "description": "Adapter to convert AWS SDK v2 to AWS CDK v3 calls", + "name": "@aws-cdk/aws-custom-resource-sdk-adapter", + "description": "Adapter to convert AWS SDK v2 to AWS CDK v3 calls for AwsCustomResource", "private": true, "version": "0.0.0", "main": "lib/index.js", @@ -36,7 +36,7 @@ "repository": { "url": "https://github.com/aws/aws-cdk.git", "type": "git", - "directory": "packages/@aws-cdk/sdk-v2-to-v3-adapter" + "directory": "packages/@aws-cdk/aws-custom-resource-sdk-adapter" }, "keywords": [ "aws", diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/test/api-call.test.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/api-call.test.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/test/api-call.test.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/api-call.test.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/test/coerce-api-parameters.test.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/coerce-api-parameters.test.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/test/coerce-api-parameters.test.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/coerce-api-parameters.test.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/test/flatten.test.ts b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/flatten.test.ts similarity index 100% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/test/flatten.test.ts rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/test/flatten.test.ts diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/tsconfig.json b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/tsconfig.json similarity index 94% rename from packages/@aws-cdk/sdk-v2-to-v3-adapter/tsconfig.json rename to packages/@aws-cdk/aws-custom-resource-sdk-adapter/tsconfig.json index db5ec7e900dce..24d6660c48ec8 100644 --- a/packages/@aws-cdk/sdk-v2-to-v3-adapter/tsconfig.json +++ b/packages/@aws-cdk/aws-custom-resource-sdk-adapter/tsconfig.json @@ -14,7 +14,7 @@ "noFallthroughCasesInSwitch": true, "resolveJsonModule": true, "composite": true, - "incremental": true + "incremental": true, }, "include": ["**/*.ts", "**/*.d.ts"] } diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/aws-events-targets/aws-api-handler/index.ts b/packages/@aws-cdk/custom-resource-handlers/lib/aws-events-targets/aws-api-handler/index.ts index 2959ef78366e5..7797717177466 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/aws-events-targets/aws-api-handler/index.ts +++ b/packages/@aws-cdk/custom-resource-handlers/lib/aws-events-targets/aws-api-handler/index.ts @@ -1,6 +1,6 @@ /* eslint-disable no-console */ // eslint-disable-next-line import/no-extraneous-dependencies -import { ApiCall } from '@aws-cdk/sdk-v2-to-v3-adapter'; +import { ApiCall } from '@aws-cdk/aws-custom-resource-sdk-adapter'; interface AwsApiInput { readonly service: string; diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v2-handler.ts b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v2-handler.ts index 650ff69d8dde8..8729b11d27ce7 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v2-handler.ts +++ b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v2-handler.ts @@ -11,7 +11,7 @@ import * as AWSLambda from 'aws-lambda'; import { AwsSdkCall } from './construct-types'; import { decodeCall, decodeSpecialValues, filterKeys, respond, startsWithOneOf } from './shared'; // eslint-disable-next-line import/no-extraneous-dependencies -import { flatten } from '@aws-cdk/sdk-v2-to-v3-adapter'; +import { flatten } from '@aws-cdk/aws-custom-resource-sdk-adapter'; let latestSdkInstalled = false; diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v3-handler.ts b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v3-handler.ts index 47908865a5106..b8bf8c413be4e 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v3-handler.ts +++ b/packages/@aws-cdk/custom-resource-handlers/lib/custom-resources/aws-custom-resource-handler/aws-sdk-v3-handler.ts @@ -2,7 +2,7 @@ /* eslint-disable no-console */ import { execSync } from 'child_process'; // eslint-disable-next-line import/no-extraneous-dependencies -import { ApiCall } from '@aws-cdk/sdk-v2-to-v3-adapter'; +import { ApiCall } from '@aws-cdk/aws-custom-resource-sdk-adapter'; // import the AWSLambda package explicitly, // which is globally available in the Lambda runtime, // as otherwise linking this repository with link-all.sh diff --git a/packages/@aws-cdk/custom-resource-handlers/package.json b/packages/@aws-cdk/custom-resource-handlers/package.json index aea85e06909c2..81d3733c7163d 100644 --- a/packages/@aws-cdk/custom-resource-handlers/package.json +++ b/packages/@aws-cdk/custom-resource-handlers/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", + "@aws-cdk/aws-custom-resource-sdk-adapter": "0.0.0", "@aws-sdk/client-ecs": "3.451.0", "@aws-sdk/client-ssm": "3.453.0", "@aws-sdk/client-kinesis": "3.451.0", diff --git a/packages/@aws-cdk/integ-tests-alpha/lib/assertions/providers/lambda-handler/sdk.ts b/packages/@aws-cdk/integ-tests-alpha/lib/assertions/providers/lambda-handler/sdk.ts index 77c9625a1f00a..ee0bea57f78d3 100644 --- a/packages/@aws-cdk/integ-tests-alpha/lib/assertions/providers/lambda-handler/sdk.ts +++ b/packages/@aws-cdk/integ-tests-alpha/lib/assertions/providers/lambda-handler/sdk.ts @@ -1,7 +1,7 @@ /* eslint-disable no-console */ import { CustomResourceHandler } from './base'; import { AwsApiCallRequest, AwsApiCallResult } from './types'; -import { ApiCall, flatten } from '@aws-cdk/sdk-v2-to-v3-adapter'; +import { ApiCall, flatten } from '@aws-cdk/aws-custom-resource-sdk-adapter'; import { decodeParameters, deepParseJson } from './utils'; export class AwsApiCallHandler extends CustomResourceHandler { diff --git a/packages/@aws-cdk/integ-tests-alpha/package.json b/packages/@aws-cdk/integ-tests-alpha/package.json index e61433c0adb3e..b037fab0d094f 100644 --- a/packages/@aws-cdk/integ-tests-alpha/package.json +++ b/packages/@aws-cdk/integ-tests-alpha/package.json @@ -69,7 +69,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/integ-runner": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", + "@aws-cdk/aws-custom-resource-sdk-adapter": "0.0.0", "@aws-sdk/client-ec2": "3.421.0", "@aws-sdk/client-s3": "3.421.0", "@aws-sdk/client-sfn": "3.421.0", diff --git a/packages/@aws-cdk/sdk-v2-to-v3-adapter/README.md b/packages/@aws-cdk/sdk-v2-to-v3-adapter/README.md deleted file mode 100644 index 33e5f6311d40f..0000000000000 --- a/packages/@aws-cdk/sdk-v2-to-v3-adapter/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# AWS SDK v2 to AWS SDK v3 Adapter tools - -Tools used to easily convert existing code from using AWS SDK v2 to AWS SDK v3. diff --git a/packages/aws-cdk-lib/package.json b/packages/aws-cdk-lib/package.json index 91d6b4d104cfc..f23eae1663249 100644 --- a/packages/aws-cdk-lib/package.json +++ b/packages/aws-cdk-lib/package.json @@ -139,7 +139,7 @@ "@aws-cdk/cdk-build-tools": "0.0.0", "@aws-cdk/custom-resource-handlers": "0.0.0", "@aws-cdk/pkglint": "0.0.0", - "@aws-cdk/sdk-v2-to-v3-adapter": "0.0.0", + "@aws-cdk/aws-custom-resource-sdk-adapter": "0.0.0", "@aws-cdk/spec2cdk": "0.0.0", "@aws-sdk/client-acm": "3.421.0", "@aws-sdk/client-account": "3.421.0", diff --git a/scripts/update-sdkv3-parameters-model.ts b/scripts/update-sdkv3-parameters-model.ts index e7d327fdd3793..bf70599d3df20 100644 --- a/scripts/update-sdkv3-parameters-model.ts +++ b/scripts/update-sdkv3-parameters-model.ts @@ -87,15 +87,15 @@ async function main(argv: string[]) { } const root = path.resolve(__dirname, '..'); - await renderStateMachineToTypeScript(sortedStateMachine, path.join(root, 'packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/parameter-types.ts')); + await renderStateMachineToTypeScript(sortedStateMachine, path.join(root, 'packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/parameter-types.ts')); await writeAllServiceToModelFile(allServices, [ path.join(root, 'packages/aws-cdk-lib/custom-resources/lib/helpers-internal/sdk-v3-metadata.json'), - path.join(root, 'packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v3-metadata.json'), + path.join(root, 'packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v3-metadata.json'), ]); await writeV2ToV3Mapping([ path.join(root, 'packages/aws-cdk-lib/custom-resources/lib/helpers-internal/sdk-v2-to-v3.json'), - path.join(root, 'packages/@aws-cdk/sdk-v2-to-v3-adapter/lib/sdk-v2-to-v3.json'), + path.join(root, 'packages/@aws-cdk/aws-custom-resource-sdk-adapter/lib/sdk-v2-to-v3.json'), ]); }