Skip to content

Commit 7e8399a

Browse files
slightly refactore role count
1 parent 171fe60 commit 7e8399a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ resource "aws_iam_role" "this" {
1919
name = var.role_name
2020
description = var.role_description
2121
max_session_duration = var.max_session_duration
22-
assume_role_policy = data.aws_iam_policy_document.this.json
22+
assume_role_policy = join("", data.aws_iam_policy_document.this.*.json)
2323
tags = var.tags
2424
# path = var.iam_role_path
2525
# permissions_boundary = var.iam_role_permissions_boundary
@@ -30,7 +30,7 @@ resource "aws_iam_role_policy_attachment" "attach" {
3030
count = var.create_oidc_role ? length(var.oidc_role_attach_policies) : 0
3131

3232
policy_arn = var.oidc_role_attach_policies[count.index]
33-
role = aws_iam_role.this[0].id
33+
role = join("", aws_iam_role.this.*.name)
3434

3535
depends_on = [aws_iam_role.this]
3636
}

0 commit comments

Comments
 (0)