From 38529514aef0b60c9be90ca7d84617fe56f41f22 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:01:56 -0700 Subject: [PATCH 1/7] test: config inside client instantiation --- .../v2-to-v3/__fixtures__/config/client.input.js | 5 +++++ .../v2-to-v3/__fixtures__/config/client.output.js | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/client.input.js create mode 100644 src/transforms/v2-to-v3/__fixtures__/config/client.output.js diff --git a/src/transforms/v2-to-v3/__fixtures__/config/client.input.js b/src/transforms/v2-to-v3/__fixtures__/config/client.input.js new file mode 100644 index 000000000..bcaa8caf2 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/client.input.js @@ -0,0 +1,5 @@ +import AWS from "aws-sdk"; + +const client = new AWS.DynamoDB({ + correctClockSkew: true +}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/config/client.output.js b/src/transforms/v2-to-v3/__fixtures__/config/client.output.js new file mode 100644 index 000000000..2ee63db30 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/config/client.output.js @@ -0,0 +1,7 @@ +import { DynamoDB } from "@aws-sdk/client-dynamodb"; + +const client = new DynamoDB({ + // The key correctClockSkew is no longer supported in v3, and can be removed. + // @deprecated The clock skew correction is applied by default. + correctClockSkew: true +}); \ No newline at end of file From 408470a48951d3dae2ae4d8e7c04c221dedaaf2d Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:06:37 -0700 Subject: [PATCH 2/7] Add utility getNewClientExpression --- .../v2-to-v3/client-instances/getNewClientExpression.ts | 7 +++++++ .../v2-to-v3/client-instances/replaceClientCreation.ts | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts diff --git a/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts new file mode 100644 index 000000000..f775efad5 --- /dev/null +++ b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts @@ -0,0 +1,7 @@ +import { ASTPath, JSCodeshift, NewExpression } from "jscodeshift"; + +export const getNewClientExpression = ( + j: JSCodeshift, + clientName: string, + v2ClientNewExpression: ASTPath +) => j.newExpression(j.identifier(clientName), v2ClientNewExpression.node.arguments); diff --git a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts index eb99ff89e..ba50eb4b2 100644 --- a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts +++ b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts @@ -1,5 +1,6 @@ import { Collection, JSCodeshift } from "jscodeshift"; import { getClientNewExpression } from "../utils"; +import { getNewClientExpression } from "./getNewClientExpression"; export interface ReplaceClientCreationOptions { v2ClientName: string; @@ -20,13 +21,13 @@ export const replaceClientCreation = ( source .find(j.NewExpression, getClientNewExpression({ v2GlobalName, v2ClientName })) .replaceWith((v2ClientNewExpression) => - j.newExpression(j.identifier(clientName), v2ClientNewExpression.node.arguments) + getNewClientExpression(j, clientName, v2ClientNewExpression) ); } source .find(j.NewExpression, getClientNewExpression({ v2ClientName, v2ClientLocalName })) .replaceWith((v2ClientNewExpression) => - j.newExpression(j.identifier(clientName), v2ClientNewExpression.node.arguments) + getNewClientExpression(j, clientName, v2ClientNewExpression) ); }; From 0c6a4e84ffbbd0a4dc98d1e09662d000bdb949fa Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:41:54 -0700 Subject: [PATCH 3/7] Transform config inside client initialization --- .../getNewClientExpression.ts | 14 +++- .../getObjectWithUpdatedAwsConfigKeys.ts | 79 +++++++++---------- .../client-instances/replaceClientCreation.ts | 12 +-- 3 files changed, 58 insertions(+), 47 deletions(-) diff --git a/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts index f775efad5..8c3325bc0 100644 --- a/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts +++ b/src/transforms/v2-to-v3/client-instances/getNewClientExpression.ts @@ -1,7 +1,19 @@ import { ASTPath, JSCodeshift, NewExpression } from "jscodeshift"; +import { getObjectWithUpdatedAwsConfigKeys } from "./getObjectWithUpdatedAwsConfigKeys"; export const getNewClientExpression = ( j: JSCodeshift, clientName: string, v2ClientNewExpression: ASTPath -) => j.newExpression(j.identifier(clientName), v2ClientNewExpression.node.arguments); +) => { + const newClientArguments = []; + + const v2ClientArguments = v2ClientNewExpression.node.arguments; + if (v2ClientArguments.length === 1 && v2ClientArguments[0].type === "ObjectExpression") { + newClientArguments.push(getObjectWithUpdatedAwsConfigKeys(j, v2ClientArguments[0])); + } else { + newClientArguments.push(...v2ClientArguments); + } + + return j.newExpression(j.identifier(clientName), newClientArguments); +}; diff --git a/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts b/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts index e073bff83..70ed869b3 100644 --- a/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts +++ b/src/transforms/v2-to-v3/client-instances/getObjectWithUpdatedAwsConfigKeys.ts @@ -16,52 +16,51 @@ const getCodemodUnsuppportedComments = (keyName: string) => [ export const getObjectWithUpdatedAwsConfigKeys = ( j: JSCodeshift, objectExpression: ObjectExpression -) => { - objectExpression.properties = objectExpression.properties.map((property) => { - if (!OBJECT_PROPERTY_TYPE_LIST.includes(property.type)) { - return property; - } +) => + j.objectExpression( + objectExpression.properties.map((property) => { + if (!OBJECT_PROPERTY_TYPE_LIST.includes(property.type)) { + return property; + } - const propertyKey = (property as Property | ObjectProperty).key; - if (propertyKey.type !== "Identifier") { - return property; - } + const propertyKey = (property as Property | ObjectProperty).key; + if (propertyKey.type !== "Identifier") { + return property; + } - const awsConfigKeyStatus = AWS_CONFIG_KEY_MAP[propertyKey.name]; + const awsConfigKeyStatus = AWS_CONFIG_KEY_MAP[propertyKey.name]; - if (!awsConfigKeyStatus) { - property.comments = property.comments || []; - for (const commentLine of getCodemodUnsuppportedComments(propertyKey.name)) { - property.comments.push(j.commentLine(commentLine)); + if (!awsConfigKeyStatus) { + property.comments = property.comments || []; + for (const commentLine of getCodemodUnsuppportedComments(propertyKey.name)) { + property.comments.push(j.commentLine(commentLine)); + } + return property; } - return property; - } - if (awsConfigKeyStatus.newKeyName) { - property.comments = property.comments || []; - property.comments.push( - j.commentLine(getRenameComment(propertyKey.name, awsConfigKeyStatus.newKeyName)) - ); - propertyKey.name = awsConfigKeyStatus.newKeyName; - } - - if (awsConfigKeyStatus.description) { - property.comments = property.comments || []; - for (const commentLine of awsConfigKeyStatus.description.split("\n")) { - property.comments.push(j.commentLine(` ${commentLine}`)); + if (awsConfigKeyStatus.newKeyName) { + property.comments = property.comments || []; + property.comments.push( + j.commentLine(getRenameComment(propertyKey.name, awsConfigKeyStatus.newKeyName)) + ); + propertyKey.name = awsConfigKeyStatus.newKeyName; } - } - if (awsConfigKeyStatus.deprecationMessage) { - property.comments = property.comments || []; - property.comments.push(j.commentLine(getUnsuppportedComment(propertyKey.name))); - property.comments.push( - j.commentLine(` @deprecated ${awsConfigKeyStatus.deprecationMessage}`) - ); - } + if (awsConfigKeyStatus.description) { + property.comments = property.comments || []; + for (const commentLine of awsConfigKeyStatus.description.split("\n")) { + property.comments.push(j.commentLine(` ${commentLine}`)); + } + } - return property; - }); + if (awsConfigKeyStatus.deprecationMessage) { + property.comments = property.comments || []; + property.comments.push(j.commentLine(getUnsuppportedComment(propertyKey.name))); + property.comments.push( + j.commentLine(` @deprecated ${awsConfigKeyStatus.deprecationMessage}`) + ); + } - return objectExpression; -}; + return property; + }) + ); diff --git a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts index ba50eb4b2..122c925ae 100644 --- a/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts +++ b/src/transforms/v2-to-v3/client-instances/replaceClientCreation.ts @@ -17,6 +17,12 @@ export const replaceClientCreation = ( ): void => { const clientName = v2ClientName === v2ClientLocalName ? v3ClientName : v2ClientLocalName; + source + .find(j.NewExpression, getClientNewExpression({ v2ClientName, v2ClientLocalName })) + .replaceWith((v2ClientNewExpression) => + getNewClientExpression(j, clientName, v2ClientNewExpression) + ); + if (v2GlobalName) { source .find(j.NewExpression, getClientNewExpression({ v2GlobalName, v2ClientName })) @@ -24,10 +30,4 @@ export const replaceClientCreation = ( getNewClientExpression(j, clientName, v2ClientNewExpression) ); } - - source - .find(j.NewExpression, getClientNewExpression({ v2ClientName, v2ClientLocalName })) - .replaceWith((v2ClientNewExpression) => - getNewClientExpression(j, clientName, v2ClientNewExpression) - ); }; From 4561b1ebcb87ce003c2c2190b88a85567f744e21 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:43:08 -0700 Subject: [PATCH 4/7] chore: yarn changeset --- .changeset/calm-carrots-cheat.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/calm-carrots-cheat.md diff --git a/.changeset/calm-carrots-cheat.md b/.changeset/calm-carrots-cheat.md new file mode 100644 index 000000000..bd7dedc25 --- /dev/null +++ b/.changeset/calm-carrots-cheat.md @@ -0,0 +1,5 @@ +--- +"aws-sdk-js-codemod": patch +--- + +Transform config inside client initialization From cbb61d5561f2615e99501060840014128fe5b43e Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 08:55:24 -0700 Subject: [PATCH 5/7] test: remove config from api-input-output-type --- .../api-input-output-type/global-import-equals.input.ts | 6 +++--- .../api-input-output-type/global-import-equals.output.ts | 6 +++--- .../api-input-output-type/global-import.input.ts | 6 +++--- .../api-input-output-type/global-import.output.ts | 6 +++--- .../api-input-output-type/service-import-deep.input.ts | 6 +++--- .../api-input-output-type/service-import-deep.output.ts | 6 +++--- .../api-input-output-type/service-import-equals.input.ts | 6 +++--- .../api-input-output-type/service-import-equals.output.ts | 6 +++--- .../api-input-output-type/service-import.input.ts | 6 +++--- .../api-input-output-type/service-import.output.ts | 6 +++--- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts index 558ea9ff1..a23d0672f 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.input.ts @@ -1,18 +1,18 @@ import AWS = require("aws-sdk"); -const ddbClient = new AWS.DynamoDB({ region: "us-west-2" }); +const ddbClient = new AWS.DynamoDB(); const listTablesInput: AWS.DynamoDB.ListTablesInput = { Limit: 10 }; const listTablesOutput: AWS.DynamoDB.ListTablesOutput = await ddbClient .listTables(listTablesInput) .promise(); -const stsClient = new AWS.STS({ region: "us-west-2" }); +const stsClient = new AWS.STS(); const getCallerIdentityInput: AWS.STS.GetCallerIdentityRequest = {}; const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = await stsClient .getCallerIdentity(getCallerIdentityInput) .promise(); -const lambdaClient = new AWS.Lambda({ region: "us-west-2" }); +const lambdaClient = new AWS.Lambda(); const invokeInput: AWS.Lambda.InvocationRequest = { FunctionName: "my-function" }; const invokeOutput: AWS.Lambda.InvocationResponse = await lambdaClient .invoke(invokeInput) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts index 9c22bbc97..4b9ccc1f6 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import-equals.output.ts @@ -11,17 +11,17 @@ import STS = AWS_client_sts.STS; import GetCallerIdentityCommandOutput = AWS_client_sts.GetCallerIdentityCommandOutput; import GetCallerIdentityCommandInput = AWS_client_sts.GetCallerIdentityCommandInput; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; const listTablesOutput: ListTablesCommandOutput = await ddbClient .listTables(listTablesInput); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient .getCallerIdentity(getCallerIdentityInput); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; const invokeOutput: InvokeCommandOutput = await lambdaClient .invoke(invokeInput); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts index 4b125ca53..77b97a50a 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.input.ts @@ -1,18 +1,18 @@ import AWS from "aws-sdk"; -const ddbClient = new AWS.DynamoDB({ region: "us-west-2" }); +const ddbClient = new AWS.DynamoDB(); const listTablesInput: AWS.DynamoDB.ListTablesInput = { Limit: 10 }; const listTablesOutput: AWS.DynamoDB.ListTablesOutput = await ddbClient .listTables(listTablesInput) .promise(); -const stsClient = new AWS.STS({ region: "us-west-2" }); +const stsClient = new AWS.STS(); const getCallerIdentityInput: AWS.STS.GetCallerIdentityRequest = {}; const getCallerIdentityOutput: AWS.STS.GetCallerIdentityResponse = await stsClient .getCallerIdentity(getCallerIdentityInput) .promise(); -const lambdaClient = new AWS.Lambda({ region: "us-west-2" }); +const lambdaClient = new AWS.Lambda(); const invokeInput: AWS.Lambda.InvocationRequest = { FunctionName: "my-function" }; const invokeOutput: AWS.Lambda.InvocationResponse = await lambdaClient .invoke(invokeInput) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts index dd50c18d5..606d75fce 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/global-import.output.ts @@ -2,17 +2,17 @@ import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws- import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; const listTablesOutput: ListTablesCommandOutput = await ddbClient .listTables(listTablesInput); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient .getCallerIdentity(getCallerIdentityInput); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; const invokeOutput: InvokeCommandOutput = await lambdaClient .invoke(invokeInput); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts index f184f7354..e5053152c 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.input.ts @@ -2,19 +2,19 @@ import DynamoDB, { ListTablesInput, ListTablesOutput } from "aws-sdk/clients/dyn import Lambda, { InvocationRequest, InvocationResponse } from "aws-sdk/clients/lambda"; import STS, { GetCallerIdentityRequest, GetCallerIdentityResponse } from "aws-sdk/clients/sts"; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesInput = { Limit: 10 }; const listTablesOutput: ListTablesOutput = await ddbClient .listTables(listTablesInput) .promise(); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityRequest = {}; const getCallerIdentityOutput: GetCallerIdentityResponse = await stsClient .getCallerIdentity(getCallerIdentityInput) .promise(); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvocationRequest = { FunctionName: "my-function" }; const invokeOutput: InvocationResponse = await lambdaClient .invoke(invokeInput) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts index dd50c18d5..606d75fce 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-deep.output.ts @@ -2,17 +2,17 @@ import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws- import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; const listTablesOutput: ListTablesCommandOutput = await ddbClient .listTables(listTablesInput); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient .getCallerIdentity(getCallerIdentityInput); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; const invokeOutput: InvokeCommandOutput = await lambdaClient .invoke(invokeInput); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts index 778eb5057..e70093f19 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.input.ts @@ -2,19 +2,19 @@ import DynamoDB = require("aws-sdk/clients/dynamodb"); import Lambda = require("aws-sdk/clients/lambda"); import STS = require("aws-sdk/clients/sts"); -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: DynamoDB.ListTablesInput = { Limit: 10 }; const listTablesOutput: DynamoDB.ListTablesOutput = await ddbClient .listTables(listTablesInput) .promise(); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: STS.GetCallerIdentityRequest = {}; const getCallerIdentityOutput: STS.GetCallerIdentityResponse = await stsClient .getCallerIdentity(getCallerIdentityInput) .promise(); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: Lambda.InvocationRequest = { FunctionName: "my-function" }; const invokeOutput: Lambda.InvocationResponse = await lambdaClient .invoke(invokeInput) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts index 9c22bbc97..4b9ccc1f6 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import-equals.output.ts @@ -11,17 +11,17 @@ import STS = AWS_client_sts.STS; import GetCallerIdentityCommandOutput = AWS_client_sts.GetCallerIdentityCommandOutput; import GetCallerIdentityCommandInput = AWS_client_sts.GetCallerIdentityCommandInput; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; const listTablesOutput: ListTablesCommandOutput = await ddbClient .listTables(listTablesInput); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient .getCallerIdentity(getCallerIdentityInput); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; const invokeOutput: InvokeCommandOutput = await lambdaClient .invoke(invokeInput); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts index 2aa4a555f..4e9fe21a4 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.input.ts @@ -1,18 +1,18 @@ import { DynamoDB, Lambda, STS } from "aws-sdk"; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: DynamoDB.ListTablesInput = { Limit: 10 }; const listTablesOutput: DynamoDB.ListTablesOutput = await ddbClient .listTables(listTablesInput) .promise(); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: STS.GetCallerIdentityRequest = {}; const getCallerIdentityOutput: STS.GetCallerIdentityResponse = await stsClient .getCallerIdentity(getCallerIdentityInput) .promise(); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: Lambda.InvocationRequest = { FunctionName: "my-function" }; const invokeOutput: Lambda.InvocationResponse = await lambdaClient .invoke(invokeInput) diff --git a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts index dd50c18d5..606d75fce 100644 --- a/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/api-input-output-type/service-import.output.ts @@ -2,17 +2,17 @@ import { DynamoDB, ListTablesCommandInput, ListTablesCommandOutput } from "@aws- import { InvokeCommandInput, InvokeCommandOutput, Lambda } from "@aws-sdk/client-lambda"; import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput, STS } from "@aws-sdk/client-sts"; -const ddbClient = new DynamoDB({ region: "us-west-2" }); +const ddbClient = new DynamoDB(); const listTablesInput: ListTablesCommandInput = { Limit: 10 }; const listTablesOutput: ListTablesCommandOutput = await ddbClient .listTables(listTablesInput); -const stsClient = new STS({ region: "us-west-2" }); +const stsClient = new STS(); const getCallerIdentityInput: GetCallerIdentityCommandInput = {}; const getCallerIdentityOutput: GetCallerIdentityCommandOutput = await stsClient .getCallerIdentity(getCallerIdentityInput); -const lambdaClient = new Lambda({ region: "us-west-2" }); +const lambdaClient = new Lambda(); const invokeInput: InvokeCommandInput = { FunctionName: "my-function" }; const invokeOutput: InvokeCommandOutput = await lambdaClient .invoke(invokeInput); \ No newline at end of file From 4a1697676e666587c1325cd65f2e4fc9de76d7bd Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 09:02:05 -0700 Subject: [PATCH 6/7] test: remove config from s3-upload --- .../v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/callback.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/callback.output.js | 2 +- .../__fixtures__/s3-upload/global-import-equals.input.ts | 2 +- .../__fixtures__/s3-upload/global-import-equals.output.ts | 2 +- .../v2-to-v3/__fixtures__/s3-upload/global-import.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/global-import.output.js | 2 +- .../__fixtures__/s3-upload/global-require-property.input.js | 2 +- .../__fixtures__/s3-upload/global-require-property.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/global-require.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/global-require.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/not-s3-client.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/not-s3-client.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/options-identifier.input.js | 2 +- .../__fixtures__/s3-upload/options-identifier.output.js | 2 +- src/transforms/v2-to-v3/__fixtures__/s3-upload/options.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/options.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/param-identifier.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/param-identifier.output.js | 2 +- .../__fixtures__/s3-upload/service-import-deep.input.js | 2 +- .../__fixtures__/s3-upload/service-import-deep.output.js | 2 +- .../__fixtures__/s3-upload/service-import-equals.input.ts | 2 +- .../__fixtures__/s3-upload/service-import-equals.output.ts | 2 +- .../v2-to-v3/__fixtures__/s3-upload/service-import.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/service-import.output.js | 2 +- .../__fixtures__/s3-upload/service-require-deep.input.js | 2 +- .../__fixtures__/s3-upload/service-require-deep.output.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/service-require.input.js | 2 +- .../v2-to-v3/__fixtures__/s3-upload/service-require.output.js | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.input.js index 2e9799fa4..0c9ecc202 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.output.js index 9bffe81b8..6cc2cb855 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback-arrow-fn.output.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.input.js index e743a2c90..328c600f2 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.output.js index 3f8715942..cb915c1c9 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/callback.output.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.input.ts index 3d4b81951..7e582ca45 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.input.ts @@ -1,6 +1,6 @@ import AWS = require("aws-sdk"); -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.output.ts index b726bf0b0..5b55078a7 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import-equals.output.ts @@ -3,7 +3,7 @@ import Upload = AWS_lib_storage.Upload; import AWS_client_s3 = require("@aws-sdk/client-s3"); import S3 = AWS_client_s3.S3; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.input.js index 9455cc234..4ab3db25d 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.output.js index 2857da279..8488c4be7 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-import.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.input.js index 96bfce0bb..14a5c2bb3 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.input.js @@ -1,6 +1,6 @@ const S3 = require("aws-sdk").S3; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.output.js index 29fb64113..d9ce6694e 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require-property.output.js @@ -6,7 +6,7 @@ const { S3 } = require("@aws-sdk/client-s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.input.js index 3cc6ab644..74ecf0a97 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.input.js @@ -1,6 +1,6 @@ const AWS = require("aws-sdk"); -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.output.js index 29fb64113..d9ce6694e 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/global-require.output.js @@ -6,7 +6,7 @@ const { S3 } = require("@aws-sdk/client-s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.input.js index 3c87bf461..4831f75df 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.input.js @@ -1,5 +1,5 @@ import AWS from "aws-sdk"; -const client = new AWS.DynamoDB({ region: "REGION" }); +const client = new AWS.DynamoDB(); // Used for testing. DynamoDB does not have upload API. await client.upload({}).promise(); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.output.js index cf3077e8b..e3cddc350 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/not-s3-client.output.js @@ -1,5 +1,5 @@ import { DynamoDB } from "@aws-sdk/client-dynamodb"; -const client = new DynamoDB({ region: "REGION" }); +const client = new DynamoDB(); // Used for testing. DynamoDB does not have upload API. await client.upload({}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.input.js index 8d63e9c95..a3161918e 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.output.js index 4d848a404..35615d6d0 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options-identifier.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); const uploadParams = { Body: "BODY", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.input.js index 3b98dd294..0810482ae 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client .upload( { diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.output.js index 6979ba9fd..6c462e944 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/options.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.input.js index 3c9370178..5348ebe13 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.input.js @@ -1,6 +1,6 @@ import AWS from "aws-sdk"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.output.js index 8d9cd63c6..fdb55ce3a 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/param-identifier.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); const uploadParams = { Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.input.js index 97edff266..858d32720 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.input.js @@ -1,6 +1,6 @@ import S3 from "aws-sdk/clients/s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.output.js index 2857da279..8488c4be7 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-deep.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.input.ts index 3ba1ac4dd..89ec7d946 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.input.ts @@ -1,6 +1,6 @@ import S3 = require("aws-sdk/clients/s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.output.ts index b726bf0b0..5b55078a7 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import-equals.output.ts @@ -3,7 +3,7 @@ import Upload = AWS_lib_storage.Upload; import AWS_client_s3 = require("@aws-sdk/client-s3"); import S3 = AWS_client_s3.S3; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.input.js index bd1a529c1..6a4dd46fd 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.input.js @@ -1,6 +1,6 @@ import { S3 } from "aws-sdk"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.output.js index 2857da279..8488c4be7 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-import.output.js @@ -1,7 +1,7 @@ import { Upload } from "@aws-sdk/lib-storage"; import { S3 } from "@aws-sdk/client-s3"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.input.js index f09b2d44b..ce1880528 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.input.js @@ -1,6 +1,6 @@ const S3 = require("aws-sdk/clients/s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.output.js index 29fb64113..d9ce6694e 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require-deep.output.js @@ -6,7 +6,7 @@ const { S3 } = require("@aws-sdk/client-s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.input.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.input.js index 92c291736..881dfeda9 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.input.js @@ -1,6 +1,6 @@ const { S3 } = require("aws-sdk"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.upload({ Body: "BODY", Bucket: "Bucket", diff --git a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.output.js b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.output.js index 29fb64113..d9ce6694e 100644 --- a/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/s3-upload/service-require.output.js @@ -6,7 +6,7 @@ const { S3 } = require("@aws-sdk/client-s3"); -const client = new S3({ region: "REGION" }); +const client = new S3(); await new Upload({ client, From 47ddf7a84e852c1d343e8ab776575e11f4dcf3ad Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Thu, 26 Oct 2023 09:04:08 -0700 Subject: [PATCH 7/7] test: remove config from waiters --- .../v2-to-v3/__fixtures__/waiters/callback-arrow-fn.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/callback-arrow-fn.output.js | 2 +- src/transforms/v2-to-v3/__fixtures__/waiters/callback.input.js | 2 +- src/transforms/v2-to-v3/__fixtures__/waiters/callback.output.js | 2 +- .../__fixtures__/waiters/config-delay-max-attempts.input.js | 2 +- .../__fixtures__/waiters/config-delay-max-attempts.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/config-delay.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/config-delay.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/config-max-attempts.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/config-max-attempts.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/global-import-equals.input.ts | 2 +- .../__fixtures__/waiters/global-import-equals.output.ts | 2 +- .../v2-to-v3/__fixtures__/waiters/global-import.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/global-import.output.js | 2 +- .../__fixtures__/waiters/global-require-property.input.js | 2 +- .../__fixtures__/waiters/global-require-property.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/global-require.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/global-require.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/multiple-waiters.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/multiple-waiters.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-import-deep.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-import-deep.output.js | 2 +- .../__fixtures__/waiters/service-import-equals.input.ts | 2 +- .../__fixtures__/waiters/service-import-equals.output.ts | 2 +- .../v2-to-v3/__fixtures__/waiters/service-import.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-import.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-require-deep.input.js | 2 +- .../__fixtures__/waiters/service-require-deep.output.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-require.input.js | 2 +- .../v2-to-v3/__fixtures__/waiters/service-require.output.js | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.input.js index 7d7fc0c11..497f1949f 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); client.waitFor("bucketExists", { Bucket }, (err, data) => { if (err) console.log(err, err.stack); // an error occurred diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.output.js index 71f5d07e8..20b3991c6 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/callback-arrow-fn.output.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); // Waiters with callbacks are not supported in AWS SDK for JavaScript (v3). // Please convert to `await client.waitFor(state, params).promise()`, and re-run aws-sdk-js-codemod. diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/callback.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/callback.input.js index a1385436f..5e5bbbcdb 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/callback.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/callback.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); client.waitFor("bucketExists", { Bucket }, function (err, data) { if (err) console.log(err, err.stack); // an error occurred diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/callback.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/callback.output.js index a7d0bd269..eac7d46ae 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/callback.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/callback.output.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); // Waiters with callbacks are not supported in AWS SDK for JavaScript (v3). // Please convert to `await client.waitFor(state, params).promise()`, and re-run aws-sdk-js-codemod. diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.input.js index cf2a969c5..ce58250c8 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.output.js index 8878949ac..139225063 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay-max-attempts.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.input.js index 1fad84e4c..3f7f1826c 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.output.js index 6581cdea4..5b96d0ea3 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-delay.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.input.js index 77747b12e..824c14e96 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.output.js index 881f390f1..9b2538b6d 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/config-max-attempts.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.input.ts index ce184b996..57c1152f9 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.input.ts @@ -1,7 +1,7 @@ import AWS = require("aws-sdk"); const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.output.ts index 50e0e0f64..e7f2c4086 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import-equals.output.ts @@ -3,7 +3,7 @@ import waitUntilBucketExists = AWS_client_s3.waitUntilBucketExists; import S3 = AWS_client_s3.S3; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.input.js index d77707fa5..fef2fc5f4 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.output.js index 672644352..0b1b59abc 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-import.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.input.js index 7276eb9eb..4d25b4687 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.input.js @@ -1,7 +1,7 @@ const S3 = require("aws-sdk").S3; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.output.js index e508862f7..c7e5c9f56 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require-property.output.js @@ -4,7 +4,7 @@ const { } = require("@aws-sdk/client-s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.input.js index 95a64eebc..9a7b8b8db 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.input.js @@ -1,7 +1,7 @@ const AWS = require("aws-sdk"); const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.output.js index e508862f7..c7e5c9f56 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/global-require.output.js @@ -4,7 +4,7 @@ const { } = require("@aws-sdk/client-s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.input.js index 7d7edcf71..6038fc70a 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.input.js @@ -1,7 +1,7 @@ import AWS from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new AWS.S3({ region: "REGION" }); +const client = new AWS.S3(); await client.waitFor("bucketNotExists", { Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.output.js index f34b7164b..6ce09a0a5 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/multiple-waiters.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists, waitUntilBucketNotExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await waitUntilBucketNotExists({ client, diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.input.js index 87d5d4cd5..c63506b64 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.input.js @@ -1,7 +1,7 @@ import S3 from "aws-sdk/clients/s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.output.js index 672644352..0b1b59abc 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-deep.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.input.ts b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.input.ts index 1bff8c08b..46810d526 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.input.ts +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.input.ts @@ -1,7 +1,7 @@ import S3 = require("aws-sdk/clients/s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.output.ts b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.output.ts index 50e0e0f64..e7f2c4086 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.output.ts +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import-equals.output.ts @@ -3,7 +3,7 @@ import waitUntilBucketExists = AWS_client_s3.waitUntilBucketExists; import S3 = AWS_client_s3.S3; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.input.js index 2e5e9f9b4..6f61b3591 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.input.js @@ -1,7 +1,7 @@ import { S3 } from "aws-sdk"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.output.js index 672644352..0b1b59abc 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-import.output.js @@ -1,7 +1,7 @@ import { S3, waitUntilBucketExists } from "@aws-sdk/client-s3"; const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.input.js index 23f0be29e..fff200b55 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.input.js @@ -1,7 +1,7 @@ const S3 = require("aws-sdk/clients/s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.output.js index e508862f7..c7e5c9f56 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require-deep.output.js @@ -4,7 +4,7 @@ const { } = require("@aws-sdk/client-s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.input.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.input.js index 6cc50f5ab..1dc345d18 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.input.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.input.js @@ -1,7 +1,7 @@ const { S3 } = require("aws-sdk"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket }).promise(); diff --git a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.output.js b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.output.js index e508862f7..c7e5c9f56 100644 --- a/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.output.js +++ b/src/transforms/v2-to-v3/__fixtures__/waiters/service-require.output.js @@ -4,7 +4,7 @@ const { } = require("@aws-sdk/client-s3"); const Bucket = "BUCKET_NAME"; -const client = new S3({ region: "REGION" }); +const client = new S3(); await client.createBucket({ Bucket });