Skip to content

Commit a7675ab

Browse files
authored
Merge pull request #221 from tablexi/update-optional-ssh-key
Update optional ssh key
2 parents 81b0bc2 + 8ecebe1 commit a7675ab

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

aws/eks_node_group/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ resource "aws_eks_node_group" "nodes" {
1919
node_role_arn = var.node_iam_role.arn
2020
tags = local.node_group_tags
2121

22-
remote_access {
23-
ec2_ssh_key = var.ec2_ssh_key
22+
dynamic "remote_access" {
23+
for_each = [var.ec2_ssh_key]
24+
content {
25+
ec2_ssh_key = remote_access.value
26+
}
2427
}
2528

2629
scaling_config {

aws/eks_node_group/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ variable "max_size" {
3434
variable "ec2_ssh_key" {
3535
description = "(Optional) EC2 Key Pair name that provides access for SSH communication with the worker nodes in the EKS Node Group."
3636
type = string
37+
default = null
3738
}
3839

3940
variable "disk_size" {

0 commit comments

Comments
 (0)