From 66a0215fdd20eaf4209b3d6ddea99d384b76bdeb Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:17:35 -0700 Subject: [PATCH] Support TemporaryCredentials --- .../v2-to-v3/__fixtures__/credentials/temp.input.js | 6 ++++++ .../v2-to-v3/__fixtures__/credentials/temp.output.js | 6 ++++++ src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts | 1 + 3 files changed, 13 insertions(+) create mode 100644 src/transforms/v2-to-v3/__fixtures__/credentials/temp.input.js create mode 100644 src/transforms/v2-to-v3/__fixtures__/credentials/temp.output.js diff --git a/src/transforms/v2-to-v3/__fixtures__/credentials/temp.input.js b/src/transforms/v2-to-v3/__fixtures__/credentials/temp.input.js new file mode 100644 index 000000000..5ff1dc141 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/credentials/temp.input.js @@ -0,0 +1,6 @@ +import AWS from "aws-sdk"; + +const credentials = new AWS.ChainableTemporaryCredentials({ + params: { RoleArn: "RoleA" }, + masterCredentials: new AWS.EnvironmentCredentials("AWS"), +}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/credentials/temp.output.js b/src/transforms/v2-to-v3/__fixtures__/credentials/temp.output.js new file mode 100644 index 000000000..b5755e882 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/credentials/temp.output.js @@ -0,0 +1,6 @@ +import { fromEnv, fromTemporaryCredentials } from "@aws-sdk/credential-providers"; + +const credentials = fromTemporaryCredentials({ + params: { RoleArn: "RoleA" }, + masterCredentials: fromEnv("AWS"), +}); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts b/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts index e2d4f810c..5e9ea9638 100644 --- a/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts +++ b/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts @@ -3,4 +3,5 @@ */ export const AWS_CREDENTIALS_MAP: Record = { EnvironmentCredentials: "fromEnv", + ChainableTemporaryCredentials: "fromTemporaryCredentials", };