Skip to content

JS SDK should try get region automatically from IMDS like other SDK languages do #6183

Description

@jedwards1211

Describe the feature

Other versions of the SDK provide an option to get the region automatically when running on an EC2 instance or Lambda (for example the Java SDK)

There doesn't seem to be any good reason that the JavaScript SDK should behave differently.

Use Case

As the Java SDK's own documentation states:

When your code runs on Amazon EC2 or AWS Lambda, you might want to configure clients to use the same AWS Region that your code is running on. This decouples your code from the environment it’s running in and makes it easier to deploy your application to multiple AWS Regions for lower latency or redundancy.

Proposed Solution

Like the Java SDK, the JavaScript SDK region provider chain should try to get the region from IMDS if it's unable to get it from AWS_REGION or config files.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

3.588

Environment details (OS name and version, etc.)

Amazon Linux 2023

Metadata

Metadata

Assignees

Labels

feature-requestNew feature or enhancement. May require GitHub community feedback.p2This is a standard priority issuequeuedThis issues is on the AWS team's backlogreleasedThe change has been released and there is a comment with the release version.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions