-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Region is missing error when using fromTemporaryCredentials #2958
Comments
Hi @kperkins-godaddy , thanks for reaching out. I can reproduce your issue, will investigate this more. In that mean time, there is a workaround solution (add another layer of region config) const opts = {
region: 'us-west-2',
credentials: fromTemporaryCredentials({
params: {
// Required. ARN of role to assume.
RoleArn: "arn:aws:iam::....",
},
clientConfig: { region : 'us-west-2'},
}
)
}
const dynamoClient = new DynamoDBClient(opts); Please let me know if this is helpful. |
Thanks a lot, i was having the same problem but with pinpoint and i was very confused due trying to set region as a property itself inside the fromTemporaryCredentials until i reached this answerd in the page 1X to end in the following answer. I thought the region would be picked up from the identitypool string i was wrong. const Voice = new PinpointSMSVoiceClient({
region: "us-west-2",
credentials: fromCognitoIdentityPool({
identityPoolId: "us-west-2:uniqueuuid",
clientConfig: { region: "us-west-2" },
})
}); |
Lol, I hit the exact same problem. Missing/overlooked the clientConfig property. Maybe the error message could contain that region could be located in clientConfig? |
I have exactly the same issue. When I use static credentials aka ACCESS_KEYS, then the code works just fine. When I use the fromTemporaryCredentials method, I consistently get "Error: Region is missing"
My code is:
When I switch the I also have set the Can someone guide me? |
Hi everyone on the thread, I've reproduced this issue with the latest version import AWS from 'aws-sdk';
const s3 = new AWS.S3({
region: 'us-east-1',
credentials: new AWS.TemporaryCredentials({
RoleArn: 'arn:aws:iam::REDACTED:role/my_role'
})
});
s3.listBuckets((err, data) => {
if (err) {
console.log("Error", err);
} else {
console.log("Bucket List", data.Buckets);
}
});
/*
Bucket List [
{ Name: 'REDACTED-REDACTED', CreationDate: 2022-08-02T21:03:10.000Z },
{
Name: 'REDACTED',
CreationDate: 2022-05-05T21:00:37.000Z
},
{
Name: 'amazon-REDACTED-REDACTED',
CreationDate: 2023-07-27T19:51:44.000Z
},
...
*/ Thank you for your patience. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Describe the bug
I get an unhandled exception (similar to #1466) when trying to read a document from dynamo using
fromTemporaryCredentials
in my client configuration:Here is the reproduction:
Your environment
SDK version number
Is the issue in the browser/Node.js/ReactNative?
Node v12
Details of the browser/Node.js/ReactNative version
Steps to reproduce
Run the code above.
The text was updated successfully, but these errors were encountered: