Skip to content

What is the alternative for the getRegion(V2) in V3 #4488

Answered by rddimon
rddimon asked this question in Q&A
Discussion options

You must be logged in to vote

I found an alternative by myself. The credential-providers was the wrong way.
I went through the AWS client's sources and found the loadConfig for the region from the @aws-sdk/node-config-provider

The solution which works for me is:

import {loadConfig} from "@aws-sdk/node-config-provider";
import {NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS} from "@aws-sdk/config-resolver";

const currentRegion = await loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS)();

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@edeesis
Comment options

Answer selected by rddimon
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants