From 8b67bbc10884385fc5e4e00c1e395e01a6cad34e Mon Sep 17 00:00:00 2001 From: haidar ali Date: Mon, 21 Oct 2024 08:40:14 +0700 Subject: [PATCH] feat(aws_instance): add instance market options block --- examples/complete/variables.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index 09259d9..2bbc692 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -73,7 +73,7 @@ variable "instance_market_options" { EOT default = null validation { - condition = contains(["spot", "capacity-block"], var.instance_market_options.market_type) + condition = var.instance_market_options != null ? contains(["spot", "capacity-block"], var.instance_market_options.market_type) : true error_message = "The value of market_type must be one of the following: \"spot\" and \"capacity-block\"." } } diff --git a/variables.tf b/variables.tf index da28317..c78fd69 100644 --- a/variables.tf +++ b/variables.tf @@ -62,7 +62,7 @@ variable "instance_market_options" { EOT default = null validation { - condition = contains(["spot", "capacity-block"], var.instance_market_options.market_type) + condition = var.instance_market_options != null ? contains(["spot", "capacity-block"], var.instance_market_options.market_type) : true error_message = "The value of market_type must be one of the following: \"spot\" and \"capacity-block\"." } }