From 58d28a2b1d60093a11e2f0ae89f25ee97fd737c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=C5=A1=20Mra=C4=8Dko?= Date: Wed, 21 Sep 2022 15:09:28 +0200 Subject: [PATCH 1/2] JSC-47988 add support of warmpool --- aws/ig/main.tf | 5 +++++ aws/ig/variables.tf | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/aws/ig/main.tf b/aws/ig/main.tf index 13ea4ab..d09bc76 100644 --- a/aws/ig/main.tf +++ b/aws/ig/main.tf @@ -26,6 +26,11 @@ locals { taints = length(var.taints) > 0 ? var.taints : null subnets = var.subnets hooks = length(var.hooks) > 0 ? var.hooks : null + warmPool = var.warm-pool != null ? { + minSize = var.warm-pool.min-size + maxSize = var.warm-pool.max-size + enableLifecycleHook = var.warm-pool.enable-lifecycle-hook + } : null rollingUpdate = { maxSurge = var.rolling-update.max-surge maxUnavailable = var.rolling-update.max-unavailable diff --git a/aws/ig/variables.tf b/aws/ig/variables.tf index f27b4f8..bf6a1f1 100644 --- a/aws/ig/variables.tf +++ b/aws/ig/variables.tf @@ -177,3 +177,14 @@ variable "rolling-update" { max-unavailable = 0 } } + +variable "warm-pool" { + type = object({ + min-size = number + max-size = number + enable-lifecycle-hook = bool + }) + description = "AWS WarmPool to get pre-initialized EC2 instances." + + nullable = true +} From 76350cc6dd816a96c5304830a4702465ba6321d7 Mon Sep 17 00:00:00 2001 From: Jiri Zizkovsky Date: Fri, 23 Sep 2022 12:58:51 +0200 Subject: [PATCH 2/2] JSC-47988 Make max-price nullable --- aws/ig/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/ig/variables.tf b/aws/ig/variables.tf index bf6a1f1..dd32d7e 100644 --- a/aws/ig/variables.tf +++ b/aws/ig/variables.tf @@ -112,7 +112,7 @@ variable "max-price" { type = string description = "If set, this group will use spot instances with the specified max-price" - default = "" + nullable = true } variable "hooks" {