Skip to content

[client-kms] Setting AWS_SDK_LOAD_CONFIG does not enable region loading from config file #6518

@ProjectFrank

Description

@ProjectFrank

Checkboxes for prior research

Describe the bug

Setting AWS_SDK_LOAD_CONFIG=true does not allow the KMSClient constructor (called with no arguments) to use the region specified in ~/.aws/config.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-kms@npm:^3.658.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.9.0

Reproduction Steps

Contents of ~/.aws/config:
[default]
region = us-east-1

Snippet:

import { KMSClient, GenerateMacCommand } from '@aws-sdk/client-kms';

const client = new KMSClient();
const keyArn = 'your-key-arn';
const command = new GenerateMacCommand({
  Message: Buffer.from('abc'),
  KeyId: keyArn,
  MacAlgorithm: 'HMAC_SHA_512',
});
await client.send(command);

Observed Behavior

When using the above snippet to make a request, I encounter the following error:

Unhandled error Error: getaddrinfo ENOTFOUND kms.undefined.amazonaws.com

Expected Behavior

I expect the command to work (e.g. by sending a request to kms.us-east-1.amazonaws.com).

Possible Solution

No response

Additional Information/Context

smithy-codegen

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions