Skip to content

Commit 43b2991

Browse files
authored
Transform explicitly set keys in AWS.config (#669)
1 parent 35690a1 commit 43b2991

14 files changed

+146
-7
lines changed

.changeset/old-ears-pull.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"aws-sdk-js-codemod": patch
3+
---
4+
5+
Transform explicitly set keys in AWS.config
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import AWS from "aws-sdk";
2+
3+
AWS.config.region = "us-west-2";
4+
5+
const client = new AWS.DynamoDB({
6+
region: "us-east-1"
7+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import AWS from "aws-sdk";
2+
3+
import { DynamoDB } from "@aws-sdk/client-dynamodb";
4+
5+
// JS SDK v3 does not support global configuration.
6+
// Codemod has attempted to pass values to each service client in this file.
7+
// You may need to update clients outside of this file, if they use global config.
8+
AWS.config.region = "us-west-2";
9+
10+
const client = new DynamoDB({
11+
region: "us-east-1"
12+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import AWS from "aws-sdk";
2+
3+
AWS.config.region = "us-west-2";
4+
5+
const client = new AWS.DynamoDB({
6+
logger: console
7+
});
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import AWS from "aws-sdk";
2+
3+
import { DynamoDB } from "@aws-sdk/client-dynamodb";
4+
5+
// JS SDK v3 does not support global configuration.
6+
// Codemod has attempted to pass values to each service client in this file.
7+
// You may need to update clients outside of this file, if they use global config.
8+
AWS.config.region = "us-west-2";
9+
10+
const client = new DynamoDB({
11+
logger: console,
12+
region: "us-west-2"
13+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import AWS from "aws-sdk";
2+
3+
AWS.config.region = "us-west-2";
4+
5+
const client = new AWS.DynamoDB();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import AWS from "aws-sdk";
2+
3+
import { DynamoDB } from "@aws-sdk/client-dynamodb";
4+
5+
// JS SDK v3 does not support global configuration.
6+
// Codemod has attempted to pass values to each service client in this file.
7+
// You may need to update clients outside of this file, if they use global config.
8+
AWS.config.region = "us-west-2";
9+
10+
const client = new DynamoDB({
11+
region: "us-west-2"
12+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import AWS from "aws-sdk";
2+
3+
AWS.config.region = "us-west-2";
4+
5+
const client = new AWS.Config({
6+
region: "us-east-1"
7+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import AWS from "aws-sdk";
2+
3+
// JS SDK v3 does not support global configuration.
4+
// Codemod has attempted to pass values to each service client in this file.
5+
// You may need to update clients outside of this file, if they use global config.
6+
AWS.config.region = "us-west-2";
7+
8+
const client = {
9+
region: "us-east-1"
10+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import AWS from "aws-sdk";
2+
3+
AWS.config.region = "us-west-2";
4+
5+
const client = new AWS.Config({
6+
logger: console
7+
});

0 commit comments

Comments
 (0)