From 854d983941f196f619c7bfda329188d5573c27da Mon Sep 17 00:00:00 2001 From: bohn002 Date: Wed, 27 May 2020 17:12:09 -0500 Subject: [PATCH 1/2] adding max_clause_count to advanced options --- README.md | 14 +++++++++++--- examples/basic_internet_endpoint.tf | 2 +- examples/basic_vpc_endpoint.tf | 4 ++-- examples/full_example.tf | 3 ++- main.tf | 7 ++++--- variables.tf | 6 ++++++ 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4e3d29e..e1bc812 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This module creates an ElasticSearch cluster. ```HCL module "elasticsearch" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" name = "es-internet-endpoint" ip_whitelist = ["1.2.3.4"] @@ -19,7 +19,7 @@ module "elasticsearch" { ```HCL module "elasticsearch" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" name = "es-vpc-endpoint" vpc_enabled = true @@ -43,6 +43,13 @@ Error creating ElasticSearch domain: ValidationException: Before you can proceed status code: 404, request id: 5a1614d2-1e64-11e9-a87e-3149d48d2026 ``` +## Requirements + +| Name | Version | +|------|---------| +| terraform | >= 0.12 | +| aws | >= 2.2.0 | + ## Providers | Name | Version | @@ -52,7 +59,7 @@ Error creating ElasticSearch domain: ValidationException: Before you can proceed ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:-----:| +|------|-------------|------|---------|:--------:| | create\_service\_linked\_role | A boolean value to determine if the ElasticSearch Service Linked Role should be created. This should only be set to true if the Service Linked Role is not already present. | `bool` | `false` | no | | data\_node\_count | Number of data nodes in the Elasticsearch cluster. If using Zone Awareness this must be a multiple of the number of subnets being used, e.g. 2, 4, 6, etc. for 2 subnets or 3, 6, 9, etc. for 3 subnets. | `number` | `6` | no | | data\_node\_instance\_type | Select data node instance type. See https://aws.amazon.com/elasticsearch-service/pricing/ for supported instance types. | `string` | `"m5.large.elasticsearch"` | no | @@ -74,6 +81,7 @@ Error creating ElasticSearch domain: ValidationException: Before you can proceed | logging\_search\_slow\_logs | A boolean value to determine if logging is enabled for SEARCH\_SLOW\_LOGS. | `bool` | `false` | no | | master\_node\_count | Number of master nodes in the Elasticsearch cluster. Allowed values are 0, 3 or 5. | `number` | `3` | no | | master\_node\_instance\_type | Select master node instance type. See https://aws.amazon.com/elasticsearch-service/pricing/ for supported instance types. | `string` | `"m5.large.elasticsearch"` | no | +| max\_clause\_count | Note the use of a string rather than an integer. Specifies the maximum number of clauses allowed in a Lucene boolean query. 1024 is the default. Queries with more than the permitted number of clauses that result in a TooManyClauses error. | `string` | `"1024"` | no | | name | The desired name for the Elasticsearch domain. | `string` | n/a | yes | | security\_groups | A list of EC2 security groups to assign to the Elasticsearch cluster. Ignored if Elasticsearch cluster is not VPC enabled. | `list(string)` | `[]` | no | | snapshot\_start\_hour | The hour (0-23) to issue a daily snapshot of Elasticsearch cluster. | `number` | `0` | no | diff --git a/examples/basic_internet_endpoint.tf b/examples/basic_internet_endpoint.tf index 5b5e7a7..aec2385 100644 --- a/examples/basic_internet_endpoint.tf +++ b/examples/basic_internet_endpoint.tf @@ -8,7 +8,7 @@ provider "aws" { } module "es_internet" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" ip_whitelist = ["1.2.3.4"] name = "es-internet-endpoint" diff --git a/examples/basic_vpc_endpoint.tf b/examples/basic_vpc_endpoint.tf index 4ce3f55..a103a17 100644 --- a/examples/basic_vpc_endpoint.tf +++ b/examples/basic_vpc_endpoint.tf @@ -8,7 +8,7 @@ provider "aws" { } module "vpc" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-vpc_basenetwork//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-vpc_basenetwork//?ref=v0.12.2" name = "Test1VPC" } @@ -21,7 +21,7 @@ module "sg" { } module "es_vpc" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" name = "es-vpc-endpoint" security_groups = [module.sg.public_web_security_group_id] diff --git a/examples/full_example.tf b/examples/full_example.tf index 2e0426f..15a69e0 100644 --- a/examples/full_example.tf +++ b/examples/full_example.tf @@ -20,7 +20,7 @@ module "internal_zone" { } module "es_all_options" { - source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" data_node_count = 8 data_node_instance_type = "r4.large.elasticsearch" @@ -42,6 +42,7 @@ module "es_all_options" { logging_search_slow_logs = true master_node_count = 5 master_node_instance_type = "r4.large.elasticsearch" + max_clause_count = "2048" name = "es-custom" security_groups = ["sg-0024aee5bbfbaddbc", "sg-018f1576271f11f3e"] snapshot_start_hour = 21 diff --git a/main.tf b/main.tf index b41a192..a6ef8c2 100644 --- a/main.tf +++ b/main.tf @@ -9,7 +9,7 @@ * * ```HCL * module "elasticsearch" { - * source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + * source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" * * name = "es-internet-endpoint" * ip_whitelist = ["1.2.3.4"] @@ -20,7 +20,7 @@ * * ```HCL * module "elasticsearch" { - * source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.1" + * source = "git@github.com:rackspace-infrastructure-automation/aws-terraform-elasticsearch//?ref=v0.12.2" * * name = "es-vpc-endpoint" * vpc_enabled = true @@ -156,7 +156,8 @@ resource "aws_elasticsearch_domain" "es" { tags = merge(var.tags, local.tags) advanced_options = { - "rest.action.multi.allow_explicit_index" = "true" + "rest.action.multi.allow_explicit_index" = "true", + "indices.query.bool.max_clause_count" = var.max_clause_count } cluster_config { diff --git a/variables.tf b/variables.tf index 6363c32..2571ac6 100644 --- a/variables.tf +++ b/variables.tf @@ -124,6 +124,12 @@ variable "master_node_instance_type" { default = "m5.large.elasticsearch" } +variable "max_clause_count" { + description = "Note the use of a string rather than an integer. Specifies the maximum number of clauses allowed in a Lucene boolean query. 1024 is the default. Queries with more than the permitted number of clauses that result in a TooManyClauses error." + type = string + default = "1024" +} + variable "name" { description = "The desired name for the Elasticsearch domain." type = string From 028d3b6bf1d068c893f0d5066fc8fc985be70963 Mon Sep 17 00:00:00 2001 From: bohn002 Date: Wed, 27 May 2020 17:24:49 -0500 Subject: [PATCH 2/2] adding max_clause_count to advanced options --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index e1bc812..b8a2d9c 100644 --- a/README.md +++ b/README.md @@ -43,13 +43,6 @@ Error creating ElasticSearch domain: ValidationException: Before you can proceed status code: 404, request id: 5a1614d2-1e64-11e9-a87e-3149d48d2026 ``` -## Requirements - -| Name | Version | -|------|---------| -| terraform | >= 0.12 | -| aws | >= 2.2.0 | - ## Providers | Name | Version | @@ -59,7 +52,7 @@ Error creating ElasticSearch domain: ValidationException: Before you can proceed ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| +|------|-------------|------|---------|:-----:| | create\_service\_linked\_role | A boolean value to determine if the ElasticSearch Service Linked Role should be created. This should only be set to true if the Service Linked Role is not already present. | `bool` | `false` | no | | data\_node\_count | Number of data nodes in the Elasticsearch cluster. If using Zone Awareness this must be a multiple of the number of subnets being used, e.g. 2, 4, 6, etc. for 2 subnets or 3, 6, 9, etc. for 3 subnets. | `number` | `6` | no | | data\_node\_instance\_type | Select data node instance type. See https://aws.amazon.com/elasticsearch-service/pricing/ for supported instance types. | `string` | `"m5.large.elasticsearch"` | no |