Skip to content

Commit 34405ed

Browse files
authored
Add transformation for AWS.ProcessCredentials (#636)
1 parent cc5f412 commit 34405ed

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

.changeset/brave-ladybugs-sparkle.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.ProcessCredentials
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.ProcessCredentials({ profile: "profile-name" });
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { fromProcess } 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+
fromProcess({ 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
@@ -7,6 +7,7 @@ export const AWS_CREDENTIALS_MAP: Record<string, string> = {
77
EC2MetadataCredentials: "fromInstanceMetadata",
88
ECSCredentials: "fromContainerMetadata",
99
EnvironmentCredentials: "fromEnv",
10+
ProcessCredentials: "fromProcess",
1011
RemoteCredentials: "fromContainerMetadata",
1112
SharedIniFileCredentials: "fromIni",
1213
SsoCredentials: "fromSSO",

0 commit comments

Comments
 (0)