【问题标题】:Add aws lambda permissions to aws elasticsearch policy将 aws lambda 权限添加到 aws elasticsearch 策略
【发布时间】:2020-10-14 12:52:10
【问题描述】:

我在我的 aws elasticsearch 访问策略中添加了以下 IP 访问限制:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:000000000000:domain/tst/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "XX.XX.XX.XX"
          ]
        }
      }
    }
  ]
}

我有一个 lambda 函数和一个 kinesis firehouse 读取和写入 elasticsearch 索引。如何将 lambda 和 kenesis firehouse 权限添加到我的弹性搜索访问策略中?

【问题讨论】:

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


    【解决方案1】:

    最后我解决如下:

    1. 将以下策略添加到 aws elasticsearch:

      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Principal": {
              "AWS": "arn:aws:iam::<account-id>:user/admin"
            },
            "Action": "es: *",
            "Resource": "example-domain.us-east-1.es.amazonaws.com:<account-id>:domain/ *"
          },
          {
            "Effect": "Allow",
            "Principal": {
              "AWS": " * "
            },
            "Action": "es:*",
            "Resource": "example-domain.us-east-1.es.amazonaws.com:<account-id>:domain/ *",
            "Condition": {
              "IpAddress": {
                "aws:SourceIp": "<my-ip>"
              }
            }
          }
        ]
      }
      
    2. 在具有安全凭证的 IAM 用户处添加以下策略:

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "elasticsearchFullAccess",
                  "Effect": "Allow",
                  "Action": [
                      "es: *"
                  ],
                  "Resource": [
                      "arn:aws:es:us-east-1:<account-id>:domain/ *"
                  ]
              }
          ]
      }
      
    3. 使用this签署请求。

    感谢this问题,我解决了这个问题

    【讨论】:

      猜你喜欢
      • 2020-09-27
      • 2019-10-14
      • 2019-10-05
      • 2019-04-18
      • 1970-01-01
      • 2019-11-26
      • 2017-01-09
      • 2019-12-09
      • 1970-01-01
      相关资源
      最近更新 更多