[英]Aws SDK: CredentialsProviderError while integrating AWS v3 Javascript SDK
I am trying to integrate Amazon STS v3 javascript sdk and am getting the below error.It seems to be requiring credentials in the new STS() initialization.What exact credentials is it expecting since I want to get the AWS credentials from Assume Role Command response.我正在尝试集成 Amazon STS v3 javascript sdk 并收到以下错误。在新的 STS() 初始化中似乎需要凭据。它期望的确切凭据是什么,因为我想从 Assume Role Command 响应中获取 AWS 凭据.
CredentialsProviderError: Could not load credentials from any providers CredentialsProviderError:无法从任何提供商加载凭据
import { STS , AssumeRoleCommand } from '@aws-sdk/client-sts'
function test() {
const client = new STS({ region: 'us-east-1'});
const params = {
RoleArm: 'arn:aws:iam:21212134:role/app',
RoleSessionName: 'Session1',
}
const command = new AssumeRoleCommand(params);
const response = await client.send(command);
}
You need to change RoleArm to RoleArn您需要将 RoleArm 更改为 RoleArn
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.