Skip to content

Commit cc5f412

Browse files
authored
Add transformation for AWS.SsoCredentials (#633)
1 parent d788e09 commit cc5f412

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.changeset/little-forks-crash.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+
Add transformation for AWS.SsoCredentials
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import AWS from "aws-sdk";
2+
3+
new AWS.SsoCredentials({ profile: "profile-name" });
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { fromSSO } from "@aws-sdk/credential-providers";
2+
3+
// JS SDK v3 switched to credential providers to functions instead of objects.
4+
// This is the closest approximation from codemod of what your application needs.
5+
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers
6+
fromSSO({ profile: "profile-name" });

src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const AWS_CREDENTIALS_MAP: Record<string, string> = {
99
EnvironmentCredentials: "fromEnv",
1010
RemoteCredentials: "fromContainerMetadata",
1111
SharedIniFileCredentials: "fromIni",
12+
SsoCredentials: "fromSSO",
1213
TokenFileWebIdentityCredentials: "fromTokenFile",
1314
WebIdentityCredentials: "fromWebToken",
1415
};

0 commit comments

Comments
 (0)