From c04e16c075129b4170684c194d65f57dcff894b9 Mon Sep 17 00:00:00 2001 From: Morre Meyer Date: Wed, 15 Dec 2021 18:26:53 +0100 Subject: [PATCH] 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. --- variables.tf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 47ed838..b1dc74d 100644 --- a/variables.tf +++ b/variables.tf @@ -116,6 +116,11 @@ variable "availability_zone_count" { type = number default = 2 description = "Number of Availability Zones for the domain to use." + + validation { + condition = contains([2, 3], var.availability_zone_count) + error_message = "The availibility zone count must be 2 or 3." + } } variable "ebs_volume_size" { @@ -357,4 +362,4 @@ variable "custom_endpoint_certificate_arn" { type = string description = "ACM certificate ARN for custom endpoint." default = "" -} \ No newline at end of file +}