Skip to content

Commit ccc4747

Browse files
authored
fix: The block_duration_minutes attribute under launch template spot_options is not a required (#1847)
1 parent 2f01a36 commit ccc4747

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

examples/complete/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ module "eks_managed_node_group" {
192192

193193
vpc_id = module.vpc.vpc_id
194194
subnet_ids = module.vpc.private_subnets
195+
vpc_security_group_ids = [
196+
module.eks.cluster_primary_security_group_id,
197+
module.eks.cluster_security_group_id,
198+
]
195199

196200
tags = merge(local.tags, { Separate = "eks-managed-node-group" })
197201
}

modules/eks-managed-node-group/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ resource "aws_launch_template" "this" {
165165
dynamic "spot_options" {
166166
for_each = lookup(instance_market_options.value, "spot_options", null) != null ? [instance_market_options.value.spot_options] : []
167167
content {
168-
block_duration_minutes = spot_options.value.block_duration_minutes
168+
block_duration_minutes = lookup(spot_options.value, "block_duration_minutes", null)
169169
instance_interruption_behavior = lookup(spot_options.value, "instance_interruption_behavior", null)
170170
max_price = lookup(spot_options.value, "max_price", null)
171171
spot_instance_type = lookup(spot_options.value, "spot_instance_type", null)

modules/self-managed-node-group/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ resource "aws_launch_template" "this" {
158158
dynamic "spot_options" {
159159
for_each = lookup(instance_market_options.value, "spot_options", null) != null ? [instance_market_options.value.spot_options] : []
160160
content {
161-
block_duration_minutes = spot_options.value.block_duration_minutes
161+
block_duration_minutes = lookup(spot_options.value, block_duration_minutes, null)
162162
instance_interruption_behavior = lookup(spot_options.value, "instance_interruption_behavior", null)
163163
max_price = lookup(spot_options.value, "max_price", null)
164164
spot_instance_type = lookup(spot_options.value, "spot_instance_type", null)

0 commit comments

Comments
 (0)