From 4ab54596894e497b5d59549bfd48b7bdfef22815 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Fri, 20 Oct 2023 08:28:11 -0700 Subject: [PATCH] Support ECSCredentials --- src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.js | 3 +++ src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.js | 3 +++ src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.js create mode 100644 src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.js diff --git a/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.js b/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.js new file mode 100644 index 000000000..8c94be923 --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.input.js @@ -0,0 +1,3 @@ +import AWS from "aws-sdk"; + +const credentials = new AWS.ECSCredentials(); \ No newline at end of file diff --git a/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.js b/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.js new file mode 100644 index 000000000..9f9f8a1ce --- /dev/null +++ b/src/transforms/v2-to-v3/__fixtures__/credentials/ecs.output.js @@ -0,0 +1,3 @@ +import { fromContainerMetadata } from "@aws-sdk/credential-providers"; + +const credentials = fromContainerMetadata(); \ 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 55f1e2f54..21b181fb8 100644 --- a/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts +++ b/src/transforms/v2-to-v3/config/AWS_CREDENTIALS_MAP.ts @@ -3,6 +3,7 @@ */ export const AWS_CREDENTIALS_MAP: Record = { EC2MetadataCredentials: "fromInstanceMetadata", + ECSCredentials: "fromContainerMetadata", EnvironmentCredentials: "fromEnv", ChainableTemporaryCredentials: "fromTemporaryCredentials", };