github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/website/source/docs/providers/aws/r/elasticsearch_domain_policy.html.markdown (about)

     1  ---
     2  layout: "aws"
     3  page_title: "AWS: aws_elasticsearch_domain"
     4  sidebar_current: "docs-aws-resource-elasticsearch-domain"
     5  description: |-
     6    Provides an ElasticSearch Domain.
     7  ---
     8  
     9  # aws\_elasticsearch\_domain\_policy
    10  
    11  Allows setting policy to an ElasticSearch domain while referencing domain attributes (e.g. ARN)
    12  
    13  ## Example Usage
    14  
    15  ```hcl
    16  resource "aws_elasticsearch_domain" "example" {
    17    domain_name           = "tf-test"
    18    elasticsearch_version = "2.3"
    19  }
    20  
    21  resource "aws_elasticsearch_domain_policy" "main" {
    22    domain_name = "${aws_elasticsearch_domain.example.domain_name}"
    23  
    24    access_policies = <<POLICIES
    25  {
    26      "Version": "2012-10-17",
    27      "Statement": [
    28          {
    29              "Action": "es:*",
    30              "Principal": "*",
    31              "Effect": "Allow",
    32              "Condition": {
    33                  "IpAddress": {"aws:SourceIp": "127.0.0.1/32"}
    34              },
    35              "Resource": "${aws_elasticsearch_domain.example.arn}"
    36          }
    37      ]
    38  }
    39  POLICIES
    40  }
    41  ```
    42  
    43  ## Argument Reference
    44  
    45  The following arguments are supported:
    46  
    47  * `domain_name` - (Required) Name of the domain.
    48  * `access_policies` - (Optional) IAM policy document specifying the access policies for the domain