Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transformation for AWS.SsoCredentials #633

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/little-forks-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

Add transformation for AWS.SsoCredentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import AWS from "aws-sdk";

new AWS.SsoCredentials({ profile: "profile-name" });
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { fromSSO } from "@aws-sdk/credential-providers";

// JS SDK v3 switched to credential providers to functions instead of objects.
// This is the closest approximation from codemod of what your application needs.
// Reference: https://www.npmjs.com/package/@aws-sdk/credential-providers
fromSSO({ profile: "profile-name" });
1 change: 1 addition & 0 deletions src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const AWS_CREDENTIALS_MAP: Record<string, string> = {
EnvironmentCredentials: "fromEnv",
RemoteCredentials: "fromContainerMetadata",
SharedIniFileCredentials: "fromIni",
SsoCredentials: "fromSSO",
TokenFileWebIdentityCredentials: "fromTokenFile",
WebIdentityCredentials: "fromWebToken",
};