Skip to content

Commit 3df47f9

Browse files
authored
Pass values from global config in service config (#667)
1 parent e00af44 commit 3df47f9

20 files changed

+242
-18
lines changed

.changeset/weak-wasps-yell.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": minor
3+
---
4+
5+
Pass values from global config in service 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.update({ 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.update({ 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.update({ 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.update({ 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.update({ 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.update({ 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.update({ 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.update({ 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.update({ region: "us-west-2" });
4+
5+
const client = new AWS.Config({
6+
logger: console
7+
});

0 commit comments

Comments
 (0)