From 650d5c9061129749509509df5131063ee41d1ee5 Mon Sep 17 00:00:00 2001 From: Flip Hess Date: Mon, 29 Jul 2019 00:25:45 +0200 Subject: [PATCH] Allow use of 3 availability zones (#23) * Allow use of 3 availability zones after terraform-providers/terraform-provider-aws#9398 * Update module documentation * Move zone_awareness out of zone_awareness_config * Add an extra az to th tfvars * Revert "Add an extra az to th tfvars" This reverts commit cdc0d26b018cfa48ec4733e19b72b90e9d0eb158. --- README.md | 1 + docs/terraform.md | 1 + main.tf | 4 ++++ variables.tf | 6 ++++++ 4 files changed, 12 insertions(+) diff --git a/README.md b/README.md index a7513c1..90fa278 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,7 @@ Available targets: | allowed_cidr_blocks | List of CIDR blocks to be allowed to connect to the cluster | list(string) | `` | no | | attributes | Additional attributes (e.g. `1`) | list(string) | `` | no | | automated_snapshot_start_hour | Hour at which automated snapshots are taken, in UTC | number | `0` | no | +| availability_zone_count | Number of Availability Zones for the domain to use. | number | `2` | no | | create_iam_service_linked_role | Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info | bool | `true` | no | | dedicated_master_count | Number of dedicated master nodes in the cluster | number | `0` | no | | dedicated_master_enabled | Indicates whether dedicated master nodes are enabled for the cluster | bool | `false` | no | diff --git a/docs/terraform.md b/docs/terraform.md index d6862d2..91864ac 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -6,6 +6,7 @@ | allowed_cidr_blocks | List of CIDR blocks to be allowed to connect to the cluster | list(string) | `` | no | | attributes | Additional attributes (e.g. `1`) | list(string) | `` | no | | automated_snapshot_start_hour | Hour at which automated snapshots are taken, in UTC | number | `0` | no | +| availability_zone_count | Number of Availability Zones for the domain to use. | number | `2` | no | | create_iam_service_linked_role | Whether to create `AWSServiceRoleForAmazonElasticsearchService` service-linked role. Set it to `false` if you already have an ElasticSearch cluster created in the AWS account and AWSServiceRoleForAmazonElasticsearchService already exists. See https://github.com/terraform-providers/terraform-provider-aws/issues/5218 for more info | bool | `true` | no | | dedicated_master_count | Number of dedicated master nodes in the cluster | number | `0` | no | | dedicated_master_enabled | Indicates whether dedicated master nodes are enabled for the cluster | bool | `false` | no | diff --git a/main.tf b/main.tf index 51b800c..d63d032 100644 --- a/main.tf +++ b/main.tf @@ -125,6 +125,10 @@ resource "aws_elasticsearch_domain" "default" { dedicated_master_count = var.dedicated_master_count dedicated_master_type = var.dedicated_master_type zone_awareness_enabled = var.zone_awareness_enabled + + zone_awareness_config { + availability_zone_count = var.availability_zone_count + } } node_to_node_encryption { diff --git a/variables.tf b/variables.tf index af9ad2a..63306bb 100644 --- a/variables.tf +++ b/variables.tf @@ -109,6 +109,12 @@ variable "zone_awareness_enabled" { description = "Enable zone awareness for Elasticsearch cluster" } +variable "availability_zone_count" { + type = number + default = 2 + description = "Number of Availability Zones for the domain to use." +} + variable "ebs_volume_size" { type = number description = "EBS volumes for data storage in GB"