消息”:“”用户:匿名无权执行:iam:PassRole

时间:2018-08-15 11:52:27

标签: amazon-web-services elasticsearch amazon-s3

我正在下面的链接“使用Amazon S3存储单个Amazon Elasticsearch Service索引”
https://aws.amazon.com/blogs/database/use-amazon-s3-to-store-a-single-amazon-elasticsearch-service-index/

当我尝试

curl -XPUT 'http://localhost:9200/_snapshot/snapshot-repository' -d'{
    "type": "s3",
    "settings": {
        "bucket": "es-s3-repository",
        "region": "us-west-2",
        "role_arn": "arn:aws:iam::123456789012:role/es-s3-repository"
    }
}'

具有更新存储区,区域和role_arn,但是我遇到了错误

{"Message":"User: anonymous is not authorized to perform: iam:PassRole on resource: arn:aws:iam...}

enter image description here

为解决此问题,我也关注了此链接https://aws.amazon.com/premiumsupport/knowledge-center/anonymous-not-authorized-elasticsearch/。但仍然无法正常工作。

1 个答案:

答案 0 :(得分:3)

您需要签署对AWS Elasticsearch的请求。您链接的博客文章描述了使用代理服务器创建签名的方法,

作为将这种代理服务器与curl结合使用的替代方法,您可以从程序发出请求。在AWS Elasticsearch docs中,为您提供了一个Python示例,其中包含指向Java客户端的链接。