Skip to content

Commit b8e18fa

Browse files
committed
Enable user data selection by node group name
1 parent 41a6616 commit b8e18fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

aws/cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module "node_groups" {
4848
role = module.node_role.instance
4949
subnets = values(data.aws_subnet.private)
5050
tags = var.tags
51-
user_data = var.user_data
51+
user_data = lookup(var.user_data, each.key, null)
5252

5353
depends_on = [module.node_role]
5454
}

aws/cluster/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ variable "tags" {
4343
}
4444

4545
variable "user_data" {
46-
type = string
46+
type = map(string)
4747
description = "Optional user data script for the launch template"
48-
default = null # Default to an empty string if no user data is provided
48+
default = {} # Default to an empty string if no user data is provided
4949
}

0 commit comments

Comments
 (0)