Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 提供基于IP的访问策略时,从我的VPN访问AWS Elasticsearch不起作用_Amazon Web Services_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Terraform - Fatal编程技术网 elasticsearch,terraform,Amazon Web Services,elasticsearch,Terraform" /> elasticsearch,terraform,Amazon Web Services,elasticsearch,Terraform" />

Amazon web services 提供基于IP的访问策略时,从我的VPN访问AWS Elasticsearch不起作用

Amazon web services 提供基于IP的访问策略时,从我的VPN访问AWS Elasticsearch不起作用,amazon-web-services,elasticsearch,terraform,Amazon Web Services,elasticsearch,Terraform,我在AWS中有一个Elasticsearch域。我已经创建了一个基于IP的访问策略,并试图在那里提供我的所有VPN CIDR块,以便我可以让此VPN中的所有计算机访问Elasticsearch和Kibana,并在Elasticsearch域上运行一些curl命令 我从ipconfig->尝试了我的IP地址,但无效 我从Google(公共IP地址)->Works尝试了我的IP地址 我尝试了我的VPN CIDR块=>不工作 "Condition": { "IpAddress": {

我在AWS中有一个Elasticsearch域。我已经创建了一个基于IP的访问策略,并试图在那里提供我的所有VPN CIDR块,以便我可以让此VPN中的所有计算机访问Elasticsearch和Kibana,并在Elasticsearch域上运行一些curl命令

我从ipconfig->尝试了我的IP地址,但无效
我从Google(公共IP地址)->Works尝试了我的IP地址
我尝试了我的VPN CIDR块=>不工作

"Condition": {
    "IpAddress": {
        "aws:SourceIp": "x.x.x.x/16"
    }
}

IP地址应该是一个数组

      "Condition": {
        "IpAddress": {"aws:SourceIp": ["youip1/32"]}
      }
我还想知道你是否错过了保险单上的资源

  "Resource": "arn:aws:es:us-west-2:${data.aws_caller_identity.user.account_id}:domain/test/*",
下面是您可以尝试的工作示例

# Creating ElasticSearch Domain with Policy
resource "aws_elasticsearch_domain" "test-domain" {
  domain_name           = "testes"
  elasticsearch_version = "6.7"

  cluster_config {
    instance_type  = "t2.small.elasticsearch"
    instance_count = 2

  }

  ebs_options {
    ebs_enabled = true
    volume_size = 10
    volume_type = "standard"
  }

  snapshot_options {
    automated_snapshot_start_hour = 23
  }

  access_policies = <<POLICY
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "es:*",
      "Principal": "*",
      "Effect": "Allow",
      "Resource": "arn:aws:es:${var.region}:${data.aws_caller_identity.user.account_id}:domain/testes/*",
      "Condition": {
        "IpAddress": {"aws:SourceIp": ["VPN_public_IP/32", "1.2.3.4/32"]}
      }
    }
  ]
}
POLICY

  tags = {
    Domain = "testes-tag"
  }
}
#使用策略创建ElasticSearch域
资源“aws\u elasticsearch\u域”“测试域”{
domain_name=“testes”
elasticsearch_version=“6.7”
群集配置{
实例_type=“t2.small.elasticsearch”
实例计数=2
}
ebs_选项{
ebs_启用=真
体积大小=10
卷类型=“标准”
}
快照选项{
自动\u快照\u开始\u小时=23
}

access_policies=只有在有多个元素的情况下才需要数组。AWS策略中可以使用单个元素值。是的,感谢@ydaetskc的澄清,或者问题可能来自VPN服务器。