Skip to content

Commit

Permalink
Add transformation for AWS.ProcessCredentials (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Oct 23, 2023
1 parent cc5f412 commit 34405ed
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-ladybugs-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"aws-sdk-js-codemod": patch
---

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

new AWS.ProcessCredentials({ profile: "profile-name" });
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { fromProcess } 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
fromProcess({ 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 @@ -7,6 +7,7 @@ export const AWS_CREDENTIALS_MAP: Record<string, string> = {
EC2MetadataCredentials: "fromInstanceMetadata",
ECSCredentials: "fromContainerMetadata",
EnvironmentCredentials: "fromEnv",
ProcessCredentials: "fromProcess",
RemoteCredentials: "fromContainerMetadata",
SharedIniFileCredentials: "fromIni",
SsoCredentials: "fromSSO",
Expand Down

0 comments on commit 34405ed

Please sign in to comment.