-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transform explicitly set keys in AWS.config (#669)
- Loading branch information
Showing
14 changed files
with
146 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"aws-sdk-js-codemod": patch | ||
--- | ||
|
||
Transform explicitly set keys in AWS.config |
7 changes: 7 additions & 0 deletions
7
src/transforms/v2-to-v3/__fixtures__/config-key/client.existing-config-overriden.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new AWS.DynamoDB({ | ||
region: "us-east-1" | ||
}); |
12 changes: 12 additions & 0 deletions
12
src/transforms/v2-to-v3/__fixtures__/config-key/client.existing-config-overriden.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
import { DynamoDB } from "@aws-sdk/client-dynamodb"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new DynamoDB({ | ||
region: "us-east-1" | ||
}); |
7 changes: 7 additions & 0 deletions
7
src/transforms/v2-to-v3/__fixtures__/config-key/client.existing-config.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new AWS.DynamoDB({ | ||
logger: console | ||
}); |
13 changes: 13 additions & 0 deletions
13
src/transforms/v2-to-v3/__fixtures__/config-key/client.existing-config.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
import { DynamoDB } from "@aws-sdk/client-dynamodb"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new DynamoDB({ | ||
logger: console, | ||
region: "us-west-2" | ||
}); |
5 changes: 5 additions & 0 deletions
5
src/transforms/v2-to-v3/__fixtures__/config-key/client.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new AWS.DynamoDB(); |
12 changes: 12 additions & 0 deletions
12
src/transforms/v2-to-v3/__fixtures__/config-key/client.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
import { DynamoDB } from "@aws-sdk/client-dynamodb"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new DynamoDB({ | ||
region: "us-west-2" | ||
}); |
7 changes: 7 additions & 0 deletions
7
...ransforms/v2-to-v3/__fixtures__/config-key/constructor.existing-config-overriden.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new AWS.Config({ | ||
region: "us-east-1" | ||
}); |
10 changes: 10 additions & 0 deletions
10
...ansforms/v2-to-v3/__fixtures__/config-key/constructor.existing-config-overriden.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const client = { | ||
region: "us-east-1" | ||
}; |
7 changes: 7 additions & 0 deletions
7
src/transforms/v2-to-v3/__fixtures__/config-key/constructor.existing-config.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const client = new AWS.Config({ | ||
logger: console | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/transforms/v2-to-v3/__fixtures__/config-key/constructor.existing-config.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const client = { | ||
logger: console, | ||
region: "us-west-2" | ||
}; |
5 changes: 5 additions & 0 deletions
5
src/transforms/v2-to-v3/__fixtures__/config-key/constructor.input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
AWS.config.region = "us-west-2"; | ||
|
||
const config = new AWS.Config(); |
10 changes: 10 additions & 0 deletions
10
src/transforms/v2-to-v3/__fixtures__/config-key/constructor.output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import AWS from "aws-sdk"; | ||
|
||
// JS SDK v3 does not support global configuration. | ||
// Codemod has attempted to pass values to each service client in this file. | ||
// You may need to update clients outside of this file, if they use global config. | ||
AWS.config.region = "us-west-2"; | ||
|
||
const config = { | ||
region: "us-west-2" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters