Skip to content

Commit 7abe8a2

Browse files
authored
Basic transformation of AWS Credentials (#598)
1 parent 577fc33 commit 7abe8a2

28 files changed

+184
-10
lines changed

.changeset/hot-insects-protect.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": minor
3+
---
4+
5+
Basic transformation of AWS Credentials
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import AWS from "aws-sdk";
2+
3+
new AWS.ChainableTemporaryCredentials({
4+
params: { RoleArn: "RoleA" },
5+
masterCredentials: existingCredentials,
6+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { fromTemporaryCredentials } 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+
fromTemporaryCredentials({
7+
params: { RoleArn: "RoleA" },
8+
masterCredentials: existingCredentials,
9+
});
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.CognitoIdentityCredentials();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { fromCognitoIdentity } 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+
fromCognitoIdentity();
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.EC2MetadataCredentials();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { fromInstanceMetadata } 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+
fromInstanceMetadata();
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.ECSCredentials();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { fromContainerMetadata } 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+
fromContainerMetadata();
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.EnvironmentCredentials("AWS");

0 commit comments

Comments
 (0)