Skip to content

Commit

Permalink
Updated tag handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
zawac002 committed Sep 14, 2023
1 parent 5c76420 commit 7bcfb0f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ data "kubernetes_namespace" "existing-ns" {
}

locals {
base_tags = {
tags = merge({
"eks-cluster-name" = var.cluster_name
"boc:tf_module_name" = local._module_name
"boc:tf_module_version" = local._module_version
"boc:created_by" = "terraform"
CostAllocation = var.tag_costallocation
}
}, var.additional_tags)

ns = try(kubernetes_namespace.ns[0].metadata[0].name, data.kubernetes_namespace.existing-ns[0].metadata[0].name)
}
Expand Down Expand Up @@ -52,7 +52,7 @@ module "loki-irsa-role" {
namespace_service_accounts = ["${var.namespace}:loki"]
}
}
tags = merge(local.base_tags, var.additional_tags)
tags = local.tags
}

resource "helm_release" "loki" {
Expand Down
4 changes: 1 addition & 3 deletions s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ module "loki-s3" {
bucket_name = format("%v-loki", var.cluster_name)
access_log_bucket = data.aws_s3_bucket.s3_server_access_logs.id

tags = {
"eks-cluster-name" = var.cluster_name
}
tags = local.tags
}
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
variable "tag_costallocation" {
description = "Tag CostAllocation (default)"
type = string
default = "csvd:infrastructure"
}

variable "additional_tags" {
Expand Down

0 comments on commit 7bcfb0f

Please sign in to comment.