Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Possible fix for issue #2006 #2008

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ data "aws_partition" "current" {}

locals {
create = var.create && var.putin_khuylo
cluster_security_group_tags = [
"Name",
"aws:eks:cluster-name",
"kubernetes.io/cluster/${var.cluster_name}",
]
}

################################################################################
Expand Down Expand Up @@ -60,7 +65,7 @@ resource "aws_eks_cluster" "this" {
}

resource "aws_ec2_tag" "cluster_primary_security_group" {
for_each = { for k, v in merge(var.tags, var.cluster_tags) : k => v if local.create }
for_each = { for k, v in merge(var.tags, var.cluster_tags) : k => v if local.create && !contains(local.cluster_security_group_tags, k) }

resource_id = aws_eks_cluster.this[0].vpc_config[0].cluster_security_group_id
key = each.key
Expand Down