Skip to content

Commit 3d8af0d

Browse files
committed
fix: Not to iterate over remote_access object in dynamic block
1 parent 3d151b2 commit 3d8af0d

File tree

2 files changed

+5
-1
lines changed
  • examples/eks_managed_node_group
  • modules/eks-managed-node-group

2 files changed

+5
-1
lines changed

examples/eks_managed_node_group/main.tf

+4
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ module "eks" {
173173
}
174174
]
175175

176+
remote_access = {
177+
ec2_ssh_key = "my-ssh-key"
178+
}
179+
176180
update_config = {
177181
max_unavailable_percentage = 50 # or set `max_unavailable`
178182
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ resource "aws_eks_node_group" "this" {
295295
}
296296

297297
dynamic "remote_access" {
298-
for_each = var.remote_access
298+
for_each = length(var.remote_access) > 0 ? [var.remote_access] : []
299299
content {
300300
ec2_ssh_key = lookup(remote_access.value, "ec2_ssh_key", null)
301301
source_security_group_ids = lookup(remote_access.value, "source_security_group_ids", [])

0 commit comments

Comments
 (0)