Commit 5825fb4 1 parent 591bef4 commit 5825fb4 Copy full SHA for 5825fb4
File tree 3 files changed +5
-5
lines changed
iam-assumable-role-with-oidc
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ resource "aws_iam_role" "this" {
66
66
}
67
67
68
68
resource "aws_iam_role_policy_attachment" "custom" {
69
- count = var. create_role && length (var . role_policy_arns ) > 0 ? length (var. role_policy_arns ) : 0
69
+ count = var. create_role ? length (var. role_policy_arns ) : 0
70
70
71
71
role = join (" " , aws_iam_role. this . * . name )
72
72
policy_arn = var. role_policy_arns [count . index ]
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ resource "aws_iam_role" "this" {
72
72
}
73
73
74
74
resource "aws_iam_role_policy_attachment" "custom" {
75
- count = var. create_role && length (var . custom_role_policy_arns ) > 0 ? length (var. custom_role_policy_arns ) : 0
75
+ count = var. create_role ? length (var. custom_role_policy_arns ) : 0
76
76
77
77
role = aws_iam_role. this [0 ]. name
78
78
policy_arn = element (var. custom_role_policy_arns , count. index )
Original file line number Diff line number Diff line change @@ -27,14 +27,14 @@ resource "aws_iam_group_policy_attachment" "iam_self_management" {
27
27
}
28
28
29
29
resource "aws_iam_group_policy_attachment" "custom_arns" {
30
- count = length (var. custom_group_policy_arns ) > 0 ? length (var . custom_group_policy_arns ) : 0
30
+ count = length (var. custom_group_policy_arns )
31
31
32
32
group = local. group_name
33
33
policy_arn = element (var. custom_group_policy_arns , count. index )
34
34
}
35
35
36
36
resource "aws_iam_group_policy_attachment" "custom" {
37
- count = length (var. custom_group_policies ) > 0 ? length (var . custom_group_policies ) : 0
37
+ count = length (var. custom_group_policies )
38
38
39
39
group = local. group_name
40
40
policy_arn = element (aws_iam_policy. custom . * . arn , count. index )
@@ -51,7 +51,7 @@ resource "aws_iam_policy" "iam_self_management" {
51
51
}
52
52
53
53
resource "aws_iam_policy" "custom" {
54
- count = length (var. custom_group_policies ) > 0 ? length (var . custom_group_policies ) : 0
54
+ count = length (var. custom_group_policies )
55
55
56
56
name = var. custom_group_policies [count . index ][" name" ]
57
57
policy = var. custom_group_policies [count . index ][" policy" ]
You can’t perform that action at this time.
0 commit comments