Skip to content

Commit 4f3553e

Browse files
committed
feat: Define Root device name for Windows worker if needed
1 parent d7630ef commit 4f3553e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

local.tf

+11-10
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,17 @@ locals {
7878
warm_pool = null # If this block is configured, add a Warm Pool to the specified Auto Scaling group.
7979

8080
# Settings for launch templates
81-
root_block_device_name = concat(data.aws_ami.eks_worker.*.root_device_name, [""])[0] # Root device name for workers. If non is provided, will assume default AMI was used.
82-
root_kms_key_id = "" # The KMS key to use when encrypting the root storage device
83-
launch_template_id = null # The id of the launch template used for managed node_groups
84-
launch_template_version = "$Latest" # The latest version of the launch template to use in the autoscaling group
85-
update_default_version = false # Update the autoscaling group launch template's default version upon each update
86-
launch_template_placement_tenancy = "default" # The placement tenancy for instances
87-
launch_template_placement_group = null # The name of the placement group into which to launch the instances, if any.
88-
root_encrypted = false # Whether the volume should be encrypted or not
89-
eni_delete = true # Delete the Elastic Network Interface (ENI) on termination (if set to false you will have to manually delete before destroying)
90-
cpu_credits = "standard" # T2/T3 unlimited mode, can be 'standard' or 'unlimited'. Used 'standard' mode as default to avoid paying higher costs
81+
root_block_device_name = concat(data.aws_ami.eks_worker.*.root_device_name, [""])[0] # Root device name for workers. If non is provided, will assume default AMI was used.
82+
root_block_device_name_windows = concat(data.aws_ami.eks_worker_windows.*.root_device_name, [""])[0] # Root device name for Windows workers. If non is provided, will assume default AMI was used.
83+
root_kms_key_id = "" # The KMS key to use when encrypting the root storage device
84+
launch_template_id = null # The id of the launch template used for managed node_groups
85+
launch_template_version = "$Latest" # The latest version of the launch template to use in the autoscaling group
86+
update_default_version = false # Update the autoscaling group launch template's default version upon each update
87+
launch_template_placement_tenancy = "default" # The placement tenancy for instances
88+
launch_template_placement_group = null # The name of the placement group into which to launch the instances, if any.
89+
root_encrypted = false # Whether the volume should be encrypted or not
90+
eni_delete = true # Delete the Elastic Network Interface (ENI) on termination (if set to false you will have to manually delete before destroying)
91+
cpu_credits = "standard" # T2/T3 unlimited mode, can be 'standard' or 'unlimited'. Used 'standard' mode as default to avoid paying higher costs
9192
market_type = null
9293
metadata_http_endpoint = "enabled" # The state of the metadata service: enabled, disabled.
9394
metadata_http_tokens = "optional" # If session tokens are required: optional, required.

workers_launch_template.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ resource "aws_launch_template" "workers_launch_template" {
438438
device_name = lookup(
439439
var.worker_groups_launch_template[count.index],
440440
"root_block_device_name",
441-
local.workers_group_defaults["root_block_device_name"],
441+
lookup(var.worker_groups_launch_template[count.index], "platform", local.workers_group_defaults["platform"]) == "windows" ? local.workers_group_defaults["root_block_device_name_windows"] : local.workers_group_defaults["root_block_device_name"],
442442
)
443443

444444
ebs {

0 commit comments

Comments
 (0)