Skip to content

Commit

Permalink
make cluster autoscaler role name shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 10, 2023
1 parent 3456f25 commit 7cf5290
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
base_tags = {
"eks-cluster-name" = var.cluster_name
"eks:cluster_name" = var.cluster_name
"boc:tf_module_version" = local._module_version
"boc:created_by" = "terraform"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ data "aws_iam_policy_document" "assume_role_policy" {
}
}

# default name too long, remove the namespace from the role name
# include the namespace and role binding in tags

module "app_role" {
source = "git@github.e.it.census.gov:terraform-modules/aws-iam-role.git?ref=tf-upgrade"

role_name = format("%v%v-irsa__%v__%v", local._prefixes["eks"], var.cluster_name, var.namespace, var.name)
# role_name = format("%v%v-irsa__%v__%v", local._prefixes["eks"], var.cluster_name, var.namespace, var.name)
role_name = format("%v%v-irsa__%v", local._prefixes["eks"], var.cluster_name, var.name)
role_description = "EKS IAM Role for ${var.cluster_name} for service account ${var.namespace}:${var.name}"
enable_ldap_creation = false
assume_policy_document = data.aws_iam_policy_document.assume_role_policy.json
Expand All @@ -30,6 +34,10 @@ module "app_role" {
local.common_tags,
var.tags,
var.application_tags,
{
"eks:namespace" = var.namespace
"eks:user" = var.name
}
)
}

Expand Down

0 comments on commit 7cf5290

Please sign in to comment.