Skip to content

Commit 29fa2c8

Browse files
chore: Update LocalStack detection to use IAMClient and ListAccountAliasesCommand
1 parent 02840e2 commit 29fa2c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/awsCredentials.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ async function isLocalStackDetected(
3030
// Enable LocalStack response header to detect LocalStack
3131
process.env.LOCALSTACK_RESPONSE_HEADER_ENABLED = 'true';
3232

33-
const { STSClient, GetCallerIdentityCommand } = await import(
34-
'@aws-sdk/client-sts'
33+
const { IAMClient, ListAccountAliasesCommand } = await import(
34+
'@aws-sdk/client-iam'
3535
);
3636

37-
const client = new STSClient({
37+
const client = new IAMClient({
3838
region: awsConfiguration.region,
3939
credentials: fromNodeProviderChain({
4040
clientConfig: { region: awsConfiguration.region },
@@ -43,7 +43,7 @@ async function isLocalStackDetected(
4343
}),
4444
});
4545

46-
const command = new GetCallerIdentityCommand({});
46+
const command = new ListAccountAliasesCommand({});
4747
const response = await client.send(command);
4848

4949
// Check for x-localstack header in response metadata

0 commit comments

Comments
 (0)