Skip to content

Commit

Permalink
added the additional_security_group_ids variable to the checks that t…
Browse files Browse the repository at this point in the history
…he launch template depends on
  • Loading branch information
nustiueudinastea committed Apr 16, 2021
1 parent aa3335a commit 3148848
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion launch-template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ locals {
launch_template_vpc_security_group_ids = (
concat(
local.ng.additional_security_group_ids,
local.need_remote_access_sg ? concat(data.aws_eks_cluster.this[0].vpc_config[*].cluster_security_group_id, aws_security_group.remote_access.*.id) : []
data.aws_eks_cluster.this[0].vpc_config[*].cluster_security_group_id,
local.need_remote_access_sg ? aws_security_group.remote_access.*.id : []
)
)

Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ locals {
configured_ami_image_id = var.ami_image_id == null ? "" : var.ami_image_id
need_ami_id = local.enabled ? local.features_require_ami && length(local.configured_ami_image_id) == 0 : false

features_require_launch_template = local.enabled ? length(var.resources_to_tag) > 0 || local.need_userdata || local.features_require_ami : false
features_require_launch_template = local.enabled ? length(var.resources_to_tag) > 0 || local.need_userdata || local.features_require_ami || length(var.additional_security_group_ids) > 0 : false

have_ssh_key = var.ec2_ssh_key != null && var.ec2_ssh_key != ""

need_remote_access_sg = local.enabled && local.have_ssh_key && local.generate_launch_template

get_cluster_data = local.enabled ? (local.need_cluster_kubernetes_version || local.need_bootstrap || local.need_remote_access_sg) : false
get_cluster_data = local.enabled ? (local.need_cluster_kubernetes_version || local.need_bootstrap || local.need_remote_access_sg || length(var.additional_security_group_ids) > 0) : false

autoscaler_enabled = var.enable_cluster_autoscaler != null ? var.enable_cluster_autoscaler : var.cluster_autoscaler_enabled == true
#
Expand Down

0 comments on commit 3148848

Please sign in to comment.