From 65777d0a37791dd1200d478e3bacc4c9a75f24c8 Mon Sep 17 00:00:00 2001 From: Lena-nfb <64463786+Lena-nfb@users.noreply.github.com> Date: Wed, 23 Dec 2020 12:08:19 +0000 Subject: [PATCH] fix: Merge tags from Fargate profiles with common tags from cluster (#1159) --- modules/fargate/fargate.tf | 1 - modules/fargate/locals.tf | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/fargate/fargate.tf b/modules/fargate/fargate.tf index f618e47cbd..d8e532709c 100644 --- a/modules/fargate/fargate.tf +++ b/modules/fargate/fargate.tf @@ -20,7 +20,6 @@ resource "aws_eks_fargate_profile" "this" { pod_execution_role_arn = local.pod_execution_role_arn subnet_ids = var.subnets tags = each.value.tags - selector { namespace = each.value.namespace labels = lookup(each.value, "labels", null) diff --git a/modules/fargate/locals.tf b/modules/fargate/locals.tf index dbd72f0107..4216953b77 100644 --- a/modules/fargate/locals.tf +++ b/modules/fargate/locals.tf @@ -4,7 +4,7 @@ locals { pod_execution_role_name = var.create_fargate_pod_execution_role ? element(concat(aws_iam_role.eks_fargate_pod.*.name, list("")), 0) : element(concat(data.aws_iam_role.custom_fargate_iam_role.*.name, list("")), 0) fargate_profiles_expanded = { for k, v in var.fargate_profiles : k => merge( - { tags = var.tags }, v, + { tags = merge(var.tags, lookup(v, "tags", {})) }, ) if var.create_eks } }