2015-10-02 00:13:32 +02:00
---
layout: "aws"
page_title: "AWS: aws_elasticsearch_domain"
2016-03-06 15:51:25 +01:00
sidebar_current: "docs-aws-resource-elasticsearch-domain"
2015-10-02 00:13:32 +02:00
description: |-
Provides an ElasticSearch Domain.
---
# aws\_elasticsearch\_domain
## Example Usage
2017-04-17 12:17:54 +02:00
```hcl
2015-10-02 00:13:32 +02:00
resource "aws_elasticsearch_domain" "es" {
2017-02-18 23:48:50 +01:00
domain_name = "tf-test"
elasticsearch_version = "1.5"
2017-03-29 17:47:42 +02:00
cluster_config {
instance_type = "r3.large.elasticsearch"
}
2015-10-02 00:13:32 +02:00
2017-02-18 23:48:50 +01:00
advanced_options {
2017-04-17 15:26:08 +02:00
"rest.action.multi.allow_explicit_index" = "true"
2017-02-18 23:48:50 +01:00
}
access_policies = < < CONFIG
2015-10-02 00:13:32 +02:00
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "es:*",
"Principal": "*",
"Effect": "Allow",
"Condition": {
"IpAddress": {"aws:SourceIp": ["66.193.100.22/32"]}
}
}
]
}
CONFIG
2017-02-18 23:48:50 +01:00
snapshot_options {
automated_snapshot_start_hour = 23
}
tags {
Domain = "TestDomain"
}
2015-10-02 00:13:32 +02:00
}
```
## Argument Reference
The following arguments are supported:
* `domain_name` - (Required) Name of the domain.
* `access_policies` - (Optional) IAM policy document specifying the access policies for the domain
* `advanced_options` - (Optional) Key-value string pairs to specify advanced configuration options.
2017-03-29 17:47:42 +02:00
* `ebs_options` - (Optional) EBS related options, may be required based on chosen [instance size ](https://aws.amazon.com/elasticsearch-service/pricing/ ). See below.
2015-10-02 00:13:32 +02:00
* `cluster_config` - (Optional) Cluster configuration of the domain, see below.
* `snapshot_options` - (Optional) Snapshot related options, see below.
2017-02-01 12:50:32 +01:00
* `elasticsearch_version` - (Optional) The version of ElasticSearch to deploy. Defaults to `1.5`
2016-02-28 02:25:07 +01:00
* `tags` - (Optional) A mapping of tags to assign to the resource
2015-10-02 00:13:32 +02:00
**ebs_options** supports the following attributes:
* `ebs_enabled` - (Required) Whether EBS volumes are attached to data nodes in the domain
* `volume_type` - (Optional) The type of EBS volumes attached to data nodes.
2017-03-29 17:47:42 +02:00
* `volume_size` - The size of EBS volumes attached to data nodes (in GB).
2016-03-17 15:00:41 +01:00
**Required** if `ebs_enabled` is set to `true` .
2015-10-02 00:13:32 +02:00
* `iops` - (Optional) The baseline input/output (I/O) performance of EBS volumes
attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type.
**cluster_config** supports the following attributes:
* `instance_type` - (Optional) Instance type of data nodes in the cluster.
* `instance_count` - (Optional) Number of instances in the cluster.
* `dedicated_master_enabled` - (Optional) Indicates whether dedicated master nodes are enabled for the cluster.
* `dedicated_master_type` - (Optional) Instance type of the dedicated master nodes in the cluster.
* `dedicated_master_count` - (Optional) Number of dedicated master nodes in the cluster
2015-10-08 22:34:17 +02:00
* `zone_awareness_enabled` - (Optional) Indicates whether zone awareness is enabled.
2015-10-02 00:13:32 +02:00
**snapshot_options** supports the following attribute:
* `automated_snapshot_start_hour` - (Required) Hour during which the service takes an automated daily
snapshot of the indices in the domain.
## Attributes Reference
The following attributes are exported:
* `arn` - Amazon Resource Name (ARN) of the domain.
* `domain_id` - Unique identifier for the domain.
* `endpoint` - Domain-specific endpoint used to submit index, search, and data upload requests.
2017-03-02 00:53:35 +01:00
## Import
ElasticSearch domains can be imported using the `domain_name` , e.g.
```
$ terraform import aws_elasticsearch_domain.example domain_name
```