Skip to content

Commit 0024928

Browse files
mstiribryantbiggs
andauthored
fix: Ensure role_name_condition is set correctly (#389)
Co-authored-by: Bryant Biggs <[email protected]>
1 parent 2b1c595 commit 0024928

File tree

2 files changed

+3
-2
lines changed
  • examples/iam-role-for-service-accounts-eks
  • modules/iam-role-for-service-accounts-eks

2 files changed

+3
-2
lines changed

examples/iam-role-for-service-accounts-eks/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ module "disabled" {
3131
module "irsa_role" {
3232
source = "../../modules/iam-role-for-service-accounts-eks"
3333

34-
role_name = local.name
34+
role_name = local.name
35+
allow_self_assume_role = true
3536

3637
oidc_providers = {
3738
one = {

modules/iam-role-for-service-accounts-eks/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ locals {
77
partition = data.aws_partition.current.partition
88
dns_suffix = data.aws_partition.current.dns_suffix
99
region = data.aws_region.current.name
10-
role_name_condition = try(coalesce(var.role_name, "${var.role_name_prefix}*"), null)
10+
role_name_condition = var.role_name != null ? var.role_name : "${var.role_name_prefix}*"
1111
}
1212

1313
data "aws_iam_policy_document" "this" {

0 commit comments

Comments
 (0)