Skip to content

Commit ab1b735

Browse files
committed
Merge branch 'master', remote-tracking branch 'origin' into support-gp3
2 parents c6e9dfe + 427ebd6 commit ab1b735

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

main.tf

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ resource "aws_elasticsearch_domain" "default" {
125125
volume_size = var.ebs_volume_size
126126
volume_type = var.ebs_volume_type
127127
iops = var.ebs_iops
128+
throughput = var.ebs_throughput
128129
}
129130

130131
encrypt_at_rest {
@@ -157,6 +158,27 @@ resource "aws_elasticsearch_domain" "default" {
157158
availability_zone_count = var.availability_zone_count
158159
}
159160
}
161+
162+
cold_storage_options {
163+
enabled = var.cold_storage_enabled
164+
}
165+
}
166+
167+
dynamic "auto_tune_options" {
168+
for_each = var.auto_tune_enabled ? [true] : []
169+
content {
170+
desired_state = "ENABLED"
171+
rollback_on_disable = var.auto_tune_rollback_settings
172+
maintenance_schedule {
173+
# Required until https://github.com/hashicorp/terraform-provider-aws/issues/22239 would be resolved
174+
start_at = var.auto_tune_starting_time == null ? timeadd(timestamp(), "1h") : var.auto_tune_starting_time
175+
duration {
176+
value = var.auto_tune_duration
177+
unit = "HOURS"
178+
}
179+
cron_expression_for_recurrence = var.auto_tune_cron_schedule
180+
}
181+
}
160182
}
161183

162184
node_to_node_encryption {
@@ -238,7 +260,7 @@ data "aws_iam_policy_document" "default" {
238260
# https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html#es-ac-types-ip
239261
# https://aws.amazon.com/premiumsupport/knowledge-center/anonymous-not-authorized-elasticsearch/
240262
dynamic "statement" {
241-
for_each = length(var.allowed_cidr_blocks) > 0 && ! var.vpc_enabled ? [true] : []
263+
for_each = length(var.allowed_cidr_blocks) > 0 && !var.vpc_enabled ? [true] : []
242264
content {
243265
effect = "Allow"
244266

@@ -296,4 +318,4 @@ module "kibana_hostname" {
296318
records = [join("", aws_elasticsearch_domain.default.*.endpoint)]
297319

298320
context = module.this.context
299-
}
321+
}

variables.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ variable "ebs_iops" {
141141
description = "The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type"
142142
}
143143

144+
variable "ebs_throughput" {
145+
type = number
146+
default = null
147+
description = "Specifies the throughput (in MiB/s) of the EBS volumes attached to data nodes. Applicable only for the gp3 volume type. Valid values are between 125 and 1000."
148+
}
149+
144150
variable "encrypt_at_rest_enabled" {
145151
type = bool
146152
default = true
@@ -363,3 +369,42 @@ variable "custom_endpoint_certificate_arn" {
363369
description = "ACM certificate ARN for custom endpoint."
364370
default = ""
365371
}
372+
373+
variable "cold_storage_enabled" {
374+
type = bool
375+
description = "Enables cold storage support."
376+
default = false
377+
}
378+
379+
variable "auto_tune_enabled" {
380+
type = bool
381+
description = "Whether to enable autotune."
382+
default = false
383+
}
384+
385+
variable "auto_tune_rollback_settings" {
386+
type = string
387+
description = "Whether to roll back to default Auto-Tune settings when disabling Auto-Tune."
388+
default = "NO_ROLLBACK"
389+
390+
validation {
391+
condition = contains(["DEFAULT_ROLLBACK", "NO_ROLLBACK"], var.auto_tune_rollback_settings)
392+
error_message = "Valid values: DEFAULT_ROLLBACK or NO_ROLLBACK."
393+
}
394+
}
395+
396+
variable "auto_tune_starting_time" {
397+
type = string
398+
description = "Date and time at which to start the Auto-Tune maintenance schedule in RFC3339 format. Time should be in the future."
399+
default = null
400+
}
401+
402+
variable "auto_tune_cron_schedule" {
403+
type = string
404+
description = "A cron expression specifying the recurrence pattern for an Auto-Tune maintenance schedule."
405+
}
406+
407+
variable "auto_tune_duration" {
408+
type = number
409+
description = "Autotune maintanance window duration time in hours."
410+
}

0 commit comments

Comments
 (0)