From ccc4747122b29ac35975e3c89edaa6ee28a86e4a Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Fri, 4 Feb 2022 15:08:43 -0500 Subject: [PATCH] fix: The `block_duration_minutes` attribute under launch template `spot_options` is not a required (#1847) --- examples/complete/main.tf | 4 ++++ modules/eks-managed-node-group/main.tf | 2 +- modules/self-managed-node-group/main.tf | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 6777788..85b02b1 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -192,6 +192,10 @@ module "eks_managed_node_group" { vpc_id = module.vpc.vpc_id subnet_ids = module.vpc.private_subnets + vpc_security_group_ids = [ + module.eks.cluster_primary_security_group_id, + module.eks.cluster_security_group_id, + ] tags = merge(local.tags, { Separate = "eks-managed-node-group" }) } diff --git a/modules/eks-managed-node-group/main.tf b/modules/eks-managed-node-group/main.tf index ecb0b7e..0341806 100644 --- a/modules/eks-managed-node-group/main.tf +++ b/modules/eks-managed-node-group/main.tf @@ -165,7 +165,7 @@ resource "aws_launch_template" "this" { dynamic "spot_options" { for_each = lookup(instance_market_options.value, "spot_options", null) != null ? [instance_market_options.value.spot_options] : [] content { - block_duration_minutes = spot_options.value.block_duration_minutes + block_duration_minutes = lookup(spot_options.value, "block_duration_minutes", null) instance_interruption_behavior = lookup(spot_options.value, "instance_interruption_behavior", null) max_price = lookup(spot_options.value, "max_price", null) spot_instance_type = lookup(spot_options.value, "spot_instance_type", null) diff --git a/modules/self-managed-node-group/main.tf b/modules/self-managed-node-group/main.tf index 3f0efc3..1b7ca66 100644 --- a/modules/self-managed-node-group/main.tf +++ b/modules/self-managed-node-group/main.tf @@ -158,7 +158,7 @@ resource "aws_launch_template" "this" { dynamic "spot_options" { for_each = lookup(instance_market_options.value, "spot_options", null) != null ? [instance_market_options.value.spot_options] : [] content { - block_duration_minutes = spot_options.value.block_duration_minutes + block_duration_minutes = lookup(spot_options.value, block_duration_minutes, null) instance_interruption_behavior = lookup(spot_options.value, "instance_interruption_behavior", null) max_price = lookup(spot_options.value, "max_price", null) spot_instance_type = lookup(spot_options.value, "spot_instance_type", null)