【发布时间】:2021-09-30 17:22:43
【问题描述】:
我想连接到 Amazon SP-API。它在文档中说我需要创建一个 AWS 账户并添加必要的权限,以便我可以使用它来连接 Amazon SP-API。我们的开发人员资料已获批准,我们已注册我们的应用程序。我尝试使用此 python SP-API library 连接这些凭据。
但是,我有一个错误提示:
botocore.exceptions.ClientError:调用 AssumeRole 操作时发生错误 (AccessDenied):用户:arn:aws:iam::
:user/username is not authorized to perform: sts:AssumeRole on resource:arn :aws:iam:: :user/username
我认为我的错误原因是我的权限政策。以下关于如何声明的政策有问题吗?
//STS-POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect" : "Allow",
"Action": "sts:*",
"Resource": "arn:aws:iam::<account_id>:user/<username>"
}
]
}
//EXECUTE-API-POLICY
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect" : "Allow",
"Action": "execute-api:*",
"Resource": "arn:aws:execute-api::<account_id>:*/*/*/*"
}
]
}
【问题讨论】:
标签: amazon-web-services amazon-iam amazon-mws aws-sts