11// Required
22variable "name" {}
3+
34variable "vpc_id" {}
5+
46variable "subnet_ids" {
57 type = " list"
68}
7- variable "zone_id" {}
89
10+ variable "zone_id" {}
911
1012// Optional
1113variable "version" {
@@ -47,6 +49,7 @@ variable "ingress_allow_cidr_blocks" {
4749variable "rest_action_multi_allow_explicit_index" {
4850 default = " true"
4951}
52+
5053variable "indices_fielddata_cache_size" {
5154 default = " "
5255}
@@ -63,7 +66,6 @@ variable "volume_size" {
6366 default = " 35"
6467}
6568
66-
6769variable "access_policies" {
6870 description = " IAM policy document specifying the access policies for the domain"
6971 default = " "
@@ -73,11 +75,11 @@ resource "aws_security_group" "elasticsearch" {
7375 name = " ${ var . name } "
7476 description = " Security Group to allow traffic to ElasticSearch"
7577
76- ingress {
77- from_port = 443
78- to_port = 443
79- protocol = " tcp"
80- cidr_blocks = [" ${ var . ingress_allow_cidr_blocks } " ]
78+ ingress {
79+ from_port = 443
80+ to_port = 443
81+ protocol = " tcp"
82+ cidr_blocks = [" ${ var . ingress_allow_cidr_blocks } " ]
8183 }
8284
8385 ingress {
@@ -102,25 +104,25 @@ resource "aws_elasticsearch_domain" "es" {
102104 elasticsearch_version = " ${ var . version } "
103105
104106 cluster_config {
105- instance_type = " ${ var . itype } "
106- instance_count = " ${ var . icount } "
107+ instance_type = " ${ var . itype } "
108+ instance_count = " ${ var . icount } "
107109 dedicated_master_enabled = " ${ var . dedicated_master } "
108- dedicated_master_type = " ${ var . mtype } "
109- dedicated_master_count = " ${ var . mcount } "
110- zone_awareness_enabled = " ${ var . zone_awareness } "
110+ dedicated_master_type = " ${ var . mtype } "
111+ dedicated_master_count = " ${ var . mcount } "
112+ zone_awareness_enabled = " ${ var . zone_awareness } "
111113 }
112114
113115 access_policies = " ${ var . access_policies } "
114116
115117 vpc_options {
116- security_group_ids = [ " ${ aws_security_group . elasticsearch . id } " ]
117- subnet_ids = [ " ${ var . subnet_ids } " ]
118+ security_group_ids = [" ${ aws_security_group . elasticsearch . id } " ]
119+ subnet_ids = [" ${ var . subnet_ids } " ]
118120 }
119121
120122 advanced_options {
121123 " rest.action.multi.allow_explicit_index" = " ${ var . rest_action_multi_allow_explicit_index } "
122- " indices.fielddata.cache.size" = " ${ var . indices_fielddata_cache_size } "
123- " indices.query.bool.max_clause_count" = " ${ var . indices_query_bool_max_clause_count } "
124+ " indices.fielddata.cache.size" = " ${ var . indices_fielddata_cache_size } "
125+ " indices.query.bool.max_clause_count" = " ${ var . indices_query_bool_max_clause_count } "
124126 }
125127
126128 ebs_options {
0 commit comments