AWS策略如何访问IP或ARN?

时间:2017-04-26 15:33:21

标签: amazon-web-services aws-lambda

如何创建AWS策略,以便访问某些IP地址 Lambda for Elasticsearch服务。

因此,可以从IP访问ES并且Lambda可以访问。

这对我不起作用:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:eu-central-1:xxx:domain/xxx/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "xxx",
            "xxx"
          ]
        }
      }
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:eu-central-1:xxx:domain/xxx/*",
      "Condition": {
        "ArnEquals": {
          "aws:SourceArn": "arn:aws:lambda:eu-central-1:xxx:function:xxx"
        }
      }
    }
  ]
}

感谢您的帮助。

0 个答案:

没有答案