【问题标题】:AWS Elasticsearch Service not authorized to perform scrollAWS Elasticsearch Service 未授权执行滚动
【发布时间】:2016-05-08 07:06:24
【问题描述】:

我正在尝试使用 elasticdump 从 AWS Elasticsearch Service 复制索引:

elasticdump --input=https://xxx.xx-xxx-x.es.amazonaws.com/my_index --output=my_index.json

政策的相关部分:

...
  "Action": "es:*",
  "Resource": [
    "arn:aws:es:xx-xxx-x:XXXXXXXX:domain/escluster/*",
    "arn:aws:es:xx-xxx-x:XXXXXXXX:domain/escluster",
    "arn:aws:es:xx-xxx-x:XXXXXXXX:domain/escluster/_search/scroll"
  ]
...

100 个对象后,我得到:

{"Message":"User: anonymous is not authorized to perform: es:ESHttpGet on resource: arn:aws:es:xx-xxx-x:XXXXXXXX:domain/escluster/_search/scroll"}

为什么 AWS 阻止我滚动?

【问题讨论】:

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


    【解决方案1】:

    您可能需要为将访问 ES 的机器添加 IP 以进行转储 我有类似的问题,添加 IP 解决了我的问题 我的政策是这样的:

    {
      "Version": "2012-10-17",
      "Statement": [
      {
        "Effect": "Allow",
        "Principal": {
          "AWS": "arn:aws:iam::<AWSACCOUNT>:root"
        },
        "Action": "es:*",
        "Resource": "arn:aws:es:us-west-1:<AWSACCOUNT>:domain/<domain>/*"
      },
      {
        "Effect": "Allow",
        "Principal": {
          "AWS": "*"
        },
        "Action": "*",
        "Resource": [
               "arn:aws:es:<AWSACCOUNT>:domain/<domain>/*",
               "arn:aws:es:<AWSACCOUNT>:domain/<domain>/_search/scroll"
               ],
        "Condition": {
          "IpAddress": {
            "aws:SourceIp": [
              <IP1>,
              <IP2>,
              <...>
            ]
          }
        }
      }
     ]
    }
    

    也许您需要在命令行中设置端口

    【讨论】:

      猜你喜欢
      • 2017-03-23
      • 2021-10-29
      • 2020-06-05
      • 2018-07-04
      • 1970-01-01
      • 2021-09-08
      • 2019-05-30
      • 2018-12-05
      • 2017-08-23
      相关资源
      最近更新 更多