diff --git a/examples/iam-role-for-service-accounts-eks/main.tf b/examples/iam-role-for-service-accounts-eks/main.tf index a8eb1eca..b7583241 100644 --- a/examples/iam-role-for-service-accounts-eks/main.tf +++ b/examples/iam-role-for-service-accounts-eks/main.tf @@ -31,7 +31,8 @@ module "disabled" { module "irsa_role" { source = "../../modules/iam-role-for-service-accounts-eks" - role_name = local.name + role_name = local.name + allow_self_assume_role = true oidc_providers = { one = { diff --git a/modules/iam-role-for-service-accounts-eks/main.tf b/modules/iam-role-for-service-accounts-eks/main.tf index b24a8fff..6095f390 100644 --- a/modules/iam-role-for-service-accounts-eks/main.tf +++ b/modules/iam-role-for-service-accounts-eks/main.tf @@ -7,7 +7,7 @@ locals { partition = data.aws_partition.current.partition dns_suffix = data.aws_partition.current.dns_suffix region = data.aws_region.current.name - role_name_condition = try(coalesce(var.role_name, "${var.role_name_prefix}*"), null) + role_name_condition = var.role_name != null ? var.role_name : "${var.role_name_prefix}*" } data "aws_iam_policy_document" "this" {