-
Hi there, In the serverless-domain-manager we use We would like to upgrade the AWS SDK to V3 but don't see an alternative in V3. We went through the credential-providers and thought about using the Do we have a possibility of getting the region based on the AWS creds? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I found an alternative by myself. The The solution which works for me is:
|
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
If you're using the latest versions of the AWS Node SDK, the imports should use the smithy namespace: import { loadConfig } from "@smithy/node-config-provider";
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@smithy/config-resolver";
const currentRegion = await loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS)(); |
Beta Was this translation helpful? Give feedback.
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: