-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: Allowing override for irsa role name #764
feat: Allowing override for irsa role name #764
Conversation
modules/irsa/main.tf
Outdated
@@ -20,7 +20,7 @@ resource "kubernetes_service_account_v1" "irsa" { | |||
resource "aws_iam_role" "irsa" { | |||
count = var.irsa_iam_policies != null ? 1 : 0 | |||
|
|||
name = format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa") | |||
name = var.addon_context.irsa_iam_role_name != null ? var.addon_context.irsa_iam_role_name : format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use:
name = var.addon_context.irsa_iam_role_name != null ? var.addon_context.irsa_iam_role_name : format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa") | |
name = try(var.addon_context.irsa_iam_role_name, format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa")) |
modules/irsa/main.tf
Outdated
@@ -46,7 +46,7 @@ resource "aws_iam_role" "irsa" { | |||
|
|||
tags = merge( | |||
{ | |||
"Name" = format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa"), | |||
"Name" = var.addon_context.irsa_iam_role_name != null ? var.addon_context.irsa_iam_role_name : format("%s-%s-%s", var.addon_context.eks_cluster_id, trim(var.kubernetes_service_account, "-*"), "irsa"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The role name is no longer controlled through tag Name
like previously so we can just remove this tag
0222b7d
to
6199558
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the change @nxf5025 🎉
What does this PR do?
Gives the ability to override the IRSA IAM role name.
Motivation
In some cases we'd like to use a custom role name instead of the current default
Closes #333
More
pre-commit run -a
with this PRNote: Not all the PRs required examples and docs except a new pattern or add-on added.
For Moderators
Additional Notes