Skip to content

Commit

Permalink
fix(dev): INFRA-350 tag EC2 with customer-ns (#336)
Browse files Browse the repository at this point in the history
See Linear ticket for testing results.

* INFRA-350 tag EC2 instances with customer-ns

* INFRA-350 switch to correct apply alb tags to eks cluster resources

* clear out example variable default value used in testing

* lint fix
  • Loading branch information
j7m4 authored Jan 31, 2025
1 parent 7868324 commit 2c87899
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/public-dns-external/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ variable "system_reserved_pid" {
}

variable "aws_loadbalancer_controller_tags" {
description = "(Optional) A map of AWS tags to apply to all resources managed by the load balancer controller"
description = "(Optional) A map of AWS tags to apply to all resources managed by load balancer and cluster"
type = map(string)
default = {}
}
9 changes: 7 additions & 2 deletions modules/app_eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ locals {
var.system_reserved_pid >= 0 ? ["pid=${var.system_reserved_pid}"] : []
]))
create_launch_template = (local.encrypt_ebs_volume || local.system_reserved != "")
defaultTags = jsonencode(merge({
"namespace" : var.namespace
},
var.aws_loadbalancer_controller_tags))
}


data "aws_subnet" "private" {
count = length(var.network_private_subnets)
id = var.network_private_subnets[count.index]
Expand Down Expand Up @@ -72,12 +77,12 @@ module "eks" {
}
}

tags = {
tags = merge(jsondecode(local.defaultTags), {
GithubRepo = "wandb"
GithubOrg = "terraform-aws-wandb"
TerraformNamespace = var.namespace
TerraformModule = "terraform-aws-wandb/module/app_eks"
}
})
}

resource "kubernetes_annotations" "gp2" {
Expand Down

0 comments on commit 2c87899

Please sign in to comment.