Skip to content

Commit

Permalink
Support 3 AZs for Terraform 0.11 (#29)
Browse files Browse the repository at this point in the history
* Support 3AZ

* make docs

Co-authored-by: Maxim Mironenko <[email protected]>
  • Loading branch information
pkoraca and maximmi authored Feb 26, 2020
1 parent 228116c commit c7d3a49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Available targets:
| allowed_cidr_blocks | List of CIDR blocks to be allowed to connect to the cluster | list | `<list>` | no |
| attributes | Additional attributes (e.g. `1`) | list | `<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 |
Expand Down Expand Up @@ -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]

Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| allowed_cidr_blocks | List of CIDR blocks to be allowed to connect to the cluster | list | `<list>` | no |
| attributes | Additional attributes (e.g. `1`) | list | `<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 |
Expand Down
8 changes: 6 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -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}"
Expand All @@ -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}"
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c7d3a49

Please sign in to comment.