Skip to content

Commit

Permalink
fix: Add missing condition role_session_name when assuming a role (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
gw0 authored Aug 30, 2023
1 parent 2ce2fd1 commit 89d011e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/iam-assumable-role/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ data "aws_iam_policy_document" "assume_role" {
values = local.role_sts_externalid
}
}

dynamic "condition" {
for_each = var.role_requires_session_name ? [1] : []
content {
test = "StringEquals"
variable = "sts:RoleSessionName"
values = var.role_session_name
}
}
}
}

Expand Down

0 comments on commit 89d011e

Please sign in to comment.