diff --git a/examples/complete-ipv6/main.tf b/examples/complete-ipv6/main.tf index d4ae54f..a371187 100644 --- a/examples/complete-ipv6/main.tf +++ b/examples/complete-ipv6/main.tf @@ -6,6 +6,8 @@ locals { Owner = "Organization_name" Expires = "Never" Department = "Engineering" + Product = "" + Environment = local.environment } kms_user = null vpc_cidr = "10.10.0.0/16" diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 145158e..285f138 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -38,6 +38,8 @@ locals { Owner = "Organization_name" Expires = "Never" Department = "Engineering" + Product = "" + Environment = local.environment } aws_managed_node_group_arch = "" #Enter your linux arch (Example:- arm64 or amd64) current_identity = data.aws_caller_identity.current.arn @@ -178,6 +180,7 @@ module "eks" { cidr_blocks = ["10.10.0.0/16"] } } + tags = local.additional_aws_tags } module "managed_node_group_addons" { @@ -222,4 +225,4 @@ module "fargate_profle" { k8s_labels = { "App-Services" = "app" } -} +} \ No newline at end of file diff --git a/modules/managed-nodegroup/main.tf b/modules/managed-nodegroup/main.tf index f0ce4be..e5edc63 100644 --- a/modules/managed-nodegroup/main.tf +++ b/modules/managed-nodegroup/main.tf @@ -66,10 +66,21 @@ resource "aws_launch_template" "eks_template" { tag_specifications { resource_type = "instance" - tags = { - Name = format("%s-%s-%s", var.environment, var.managed_ng_name, "eks-node") - Environment = var.environment - } + tags = merge( + { + Name = format("%s-%s-%s", var.environment, var.managed_ng_name, "eks-node") + }, + var.tags + ) + } + tag_specifications { + resource_type = "volume" + tags = merge( + { + Name = format("%s-%s-%s", var.environment, var.managed_ng_name, "eks-volume") + }, + var.tags + ) } lifecycle { @@ -98,8 +109,10 @@ resource "aws_eks_node_group" "managed_ng" { update_config { max_unavailable_percentage = 50 } - tags = { - Name = format("%s-%s-%s", var.environment, var.managed_ng_name, "ng") - Environment = var.environment - } + tags = merge( + { + Name = format("%s-%s-%s", var.environment, var.managed_ng_name, "ng") + }, + var.tags + ) }