Skip to content

Commit

Permalink
feat: support multi_az_with_standby_enabled for opensearch
Browse files Browse the repository at this point in the history
Note that this bumps the minimum `hashicorp/aws` provider version to
5.15.0, where this parameter was introduced [[1]].

[1]: https://github.com/hashicorp/terraform-provider-aws/blob/main/CHANGELOG.md#5150-august-31-2023
Closes: cloudposse#195
  • Loading branch information
lukehsiao committed Oct 12, 2024
1 parent d6a3038 commit 2dc476e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ Available targets:
| <a name="input_log_publishing_index_enabled"></a> [log\_publishing\_index\_enabled](#input\_log\_publishing\_index\_enabled) | Specifies whether log publishing option for INDEX\_SLOW\_LOGS is enabled or not | `bool` | `false` | no |
| <a name="input_log_publishing_search_cloudwatch_log_group_arn"></a> [log\_publishing\_search\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_search\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for SEARCH\_SLOW\_LOGS needs to be published | `string` | `""` | no |
| <a name="input_log_publishing_search_enabled"></a> [log\_publishing\_search\_enabled](#input\_log\_publishing\_search\_enabled) | Specifies whether log publishing option for SEARCH\_SLOW\_LOGS is enabled or not | `bool` | `false` | no |
| <a name="multi_az_with_standby_enabled"></a> [multi\_az\_with\_standby\_enabled](#multi\_az\_with\_standby\_enabled) | Enable domain with standby for OpenSearch cluster | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br/>This is the only ID element not also included as a `tag`.<br/>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
| <a name="input_node_to_node_encryption_enabled"></a> [node\_to\_node\_encryption\_enabled](#input\_node\_to\_node\_encryption\_enabled) | Whether to enable node-to-node encryption | `bool` | `false` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
| <a name="input_log_publishing_index_enabled"></a> [log\_publishing\_index\_enabled](#input\_log\_publishing\_index\_enabled) | Specifies whether log publishing option for INDEX\_SLOW\_LOGS is enabled or not | `bool` | `false` | no |
| <a name="input_log_publishing_search_cloudwatch_log_group_arn"></a> [log\_publishing\_search\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_search\_cloudwatch\_log\_group\_arn) | ARN of the CloudWatch log group to which log for SEARCH\_SLOW\_LOGS needs to be published | `string` | `""` | no |
| <a name="input_log_publishing_search_enabled"></a> [log\_publishing\_search\_enabled](#input\_log\_publishing\_search\_enabled) | Specifies whether log publishing option for SEARCH\_SLOW\_LOGS is enabled or not | `bool` | `false` | no |
| <a name="multi_az_with_standby_enabled"></a> [multi\_az\_with\_standby\_enabled](#multi\_az\_with\_standby\_enabled) | Enable domain with standby for OpenSearch cluster | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br>This is the only ID element not also included as a `tag`.<br>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
| <a name="input_node_to_node_encryption_enabled"></a> [node\_to\_node\_encryption\_enabled](#input\_node\_to\_node\_encryption\_enabled) | Whether to enable node-to-node encryption | `bool` | `false` | no |
Expand Down
19 changes: 10 additions & 9 deletions opensearch_domain.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ resource "aws_opensearch_domain" "default" {
}

cluster_config {
instance_count = var.instance_count
instance_type = var.instance_type
dedicated_master_enabled = var.dedicated_master_enabled
dedicated_master_count = var.dedicated_master_count
dedicated_master_type = var.dedicated_master_type
zone_awareness_enabled = var.zone_awareness_enabled
warm_enabled = var.warm_enabled
warm_count = var.warm_enabled ? var.warm_count : null
warm_type = var.warm_enabled ? var.warm_type : null
instance_count = var.instance_count
instance_type = var.instance_type
dedicated_master_enabled = var.dedicated_master_enabled
dedicated_master_count = var.dedicated_master_count
dedicated_master_type = var.dedicated_master_type
multi_az_with_standby_enabled = var.multi_az_with_standby_enabled
zone_awareness_enabled = var.zone_awareness_enabled
warm_enabled = var.warm_enabled
warm_count = var.warm_enabled ? var.warm_count : null
warm_type = var.warm_enabled ? var.warm_type : null

dynamic "zone_awareness_config" {
for_each = var.availability_zone_count > 1 && var.zone_awareness_enabled ? [true] : []
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ variable "availability_zone_count" {
}
}

variable "multi_az_with_standby_enabled" {
type = bool
default = false
description = "Enable domain with standby for OpenSearch cluster"
}

variable "ebs_volume_size" {
type = number
description = "EBS volumes for data storage in GB"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.35.0"
version = ">= 5.15.0"
}
}
}

0 comments on commit 2dc476e

Please sign in to comment.