Skip to content

Commit

Permalink
fix: Not to iterate over remote_access object in dynamic block
Browse files Browse the repository at this point in the history
  • Loading branch information
knight42 committed Jan 6, 2022
1 parent 3d151b2 commit 3d8af0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/eks_managed_node_group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ module "eks" {
}
]

remote_access = {
ec2_ssh_key = "my-ssh-key"
}

update_config = {
max_unavailable_percentage = 50 # or set `max_unavailable`
}
Expand Down
2 changes: 1 addition & 1 deletion modules/eks-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ resource "aws_eks_node_group" "this" {
}

dynamic "remote_access" {
for_each = var.remote_access
for_each = length(var.remote_access) > 0 ? [var.remote_access] : []
content {
ec2_ssh_key = lookup(remote_access.value, "ec2_ssh_key", null)
source_security_group_ids = lookup(remote_access.value, "source_security_group_ids", [])
Expand Down

0 comments on commit 3d8af0d

Please sign in to comment.