Skip to content

Commit

Permalink
Replace config credentialsProvider with credentials (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Apr 11, 2024
1 parent 08f1e72 commit f2100df
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-readers-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

Replace config credentialsProvider with credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import AWS from "aws-sdk";

const config = new AWS.Config({
credentialProvider: () => Promise.resolve({
accessKeyId: "AKID",
secretAccessKey: "SECRET"
})
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const config = {
// The key credentialProvider is renamed to credentials.
// The credentials in JS SDK v3 accepts providers.
credentials: () => Promise.resolve({
accessKeyId: "AKID",
secretAccessKey: "SECRET"
})
};
4 changes: 4 additions & 0 deletions src/transforms/v2-to-v3/config/AWS_CONFIG_KEY_MAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const AWS_CONFIG_KEY_MAP: Record<string, AwsConfigKeyStatus> = {
deprecationMessage: "The clock skew correction is applied by default.",
},
credentials: {},
credentialProvider: {
newKeyName: "credentials",
description: "The credentials in JS SDK v3 accepts providers.",
},
endpoint: {},
endpointCacheSize: {},
endpointDiscoveryEnabled: {},
Expand Down

0 comments on commit f2100df

Please sign in to comment.