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

Provide support of additional tags in all the aws resources specifically on eks nodes #57

Open
wants to merge 7 commits into
base: release-5.1.1
Choose a base branch
from
2 changes: 2 additions & 0 deletions examples/complete-ipv6/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -178,6 +180,7 @@ module "eks" {
cidr_blocks = ["10.10.0.0/16"]
}
}
tags = local.additional_aws_tags
}

module "managed_node_group_addons" {
Expand Down Expand Up @@ -222,4 +225,4 @@ module "fargate_profle" {
k8s_labels = {
"App-Services" = "app"
}
}
}
29 changes: 21 additions & 8 deletions modules/managed-nodegroup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
)
}