Skip to content

Commit c04e16c

Browse files
authored
feat: add validation to availability_zone_count (#122)
This ensures that availability_zone_count is only set to allowed values, see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticsearch_domain#availability_zone_count.
1 parent 195e519 commit c04e16c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

variables.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ variable "availability_zone_count" {
116116
type = number
117117
default = 2
118118
description = "Number of Availability Zones for the domain to use."
119+
120+
validation {
121+
condition = contains([2, 3], var.availability_zone_count)
122+
error_message = "The availibility zone count must be 2 or 3."
123+
}
119124
}
120125

121126
variable "ebs_volume_size" {
@@ -357,4 +362,4 @@ variable "custom_endpoint_certificate_arn" {
357362
type = string
358363
description = "ACM certificate ARN for custom endpoint."
359364
default = ""
360-
}
365+
}

0 commit comments

Comments
 (0)