github.com/nevins-b/terraform@v0.3.8-0.20170215184714-bbae22007d5a/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 ``` 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 access_policies = <<POLICIES 24 { 25 "Version": "2012-10-17", 26 "Statement": [ 27 { 28 "Action": "es:*", 29 "Principal": "*", 30 "Effect": "Allow", 31 "Condition": { 32 "IpAddress": {"aws:SourceIp": "127.0.0.1/32"} 33 }, 34 "Resource": "${aws_elasticsearch_domain.example.arn}" 35 } 36 ] 37 } 38 POLICIES 39 } 40 ``` 41 42 ## Argument Reference 43 44 The following arguments are supported: 45 46 * `domain_name` - (Required) Name of the domain. 47 * `access_policies` - (Optional) IAM policy document specifying the access policies for the domain