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

dee*_*gla 6 amazon-s3 amazon-web-services elasticsearch

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

当我尝试

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"
    }
}'
Run Code Online (Sandbox Code Playgroud)

使用更新存储桶、区域和 role_arn,但出现以下错误

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

在此处输入图片说明

为了解决这个问题,我也点击了这个链接https://aws.amazon.com/premiumsupport/knowledge-center/anonymous-not-authorized-elasticsearch/。但它仍然不起作用。

小智 8

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

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