From c7d3a494ddb1f5d547fd81782b7937cddc59ceda Mon Sep 17 00:00:00 2001 From: Petar Koraca Date: Thu, 27 Feb 2020 00:34:21 +0100 Subject: [PATCH] Support 3 AZs for Terraform 0.11 (#29) * Support 3AZ * make docs Co-authored-by: Maxim Mironenko --- README.md | 2 ++ docs/terraform.md | 1 + main.tf | 8 ++++++-- variables.tf | 6 ++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cfff9cf..2da159a 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ Available targets: | allowed_cidr_blocks | List of CIDR blocks to be allowed to connect to the cluster | list | `` | no | | attributes | Additional attributes (e.g. `1`) | list | `` | no | | automated_snapshot_start_hour | Hour at which automated snapshots are taken, in UTC | string | `0` | no | +| availability_zone_count | Number of Availability Zones for the domain to use. | string | `3` | 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 | string | `true` | no | | dedicated_master_count | Number of dedicated master nodes in the cluster | string | `0` | no | | dedicated_master_enabled | Indicates whether dedicated master nodes are enabled for the cluster | string | `false` | no | @@ -352,6 +353,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply [sarkis_homepage]: https://github.com/sarkis [sarkis_avatar]: https://img.cloudposse.com/150x150/https://github.com/sarkis.png + [![README Footer][readme_footer_img]][readme_footer_link] [![Beacon][beacon]][website] diff --git a/docs/terraform.md b/docs/terraform.md index 8e1b29b..a3d844a 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 | `` | no | | attributes | Additional attributes (e.g. `1`) | list | `` | no | | automated_snapshot_start_hour | Hour at which automated snapshots are taken, in UTC | string | `0` | no | +| availability_zone_count | Number of Availability Zones for the domain to use. | string | `3` | 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 | string | `true` | no | | dedicated_master_count | Number of dedicated master nodes in the cluster | string | `0` | no | | dedicated_master_enabled | Indicates whether dedicated master nodes are enabled for the cluster | string | `false` | no | diff --git a/main.tf b/main.tf index 39c28b1..243e39f 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ module "label" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.7.0" enabled = "${var.enabled}" namespace = "${var.namespace}" name = "${var.name}" @@ -10,7 +10,7 @@ module "label" { } module "user_label" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.7.0" enabled = "${var.enabled}" namespace = "${var.namespace}" name = "${var.name}" @@ -127,6 +127,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 8fbcb93..8fe6fc4 100644 --- a/variables.tf +++ b/variables.tf @@ -216,6 +216,12 @@ variable "node_to_node_encryption_enabled" { description = "Whether to enable node-to-node encryption" } +variable "availability_zone_count" { + type = "string" + default = "3" + description = "Number of Availability Zones for the domain to use." +} + variable "iam_role_max_session_duration" { default = 3600 description = "The maximum session duration (in seconds) for the user role. Can have a value from 1 hour to 12 hours"