File tree Expand file tree Collapse file tree 5 files changed +9
-15
lines changed
iam-assumable-role-with-oidc
iam-assumable-role-with-saml Expand file tree Collapse file tree 5 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -95,14 +95,14 @@ resource "aws_iam_role" "this" {
95
95
force_detach_policies = var. force_detach_policies
96
96
permissions_boundary = var. role_permissions_boundary_arn
97
97
98
- assume_role_policy = join ( " " , data. aws_iam_policy_document . assume_role_with_oidc . * . json )
98
+ assume_role_policy = data. aws_iam_policy_document . assume_role_with_oidc [ 0 ] . json
99
99
100
100
tags = var. tags
101
101
}
102
102
103
103
resource "aws_iam_role_policy_attachment" "custom" {
104
104
count = var. create_role ? local. number_of_role_policy_arns : 0
105
105
106
- role = join ( " " , aws_iam_role. this . * . name )
106
+ role = aws_iam_role. this [ 0 ] . name
107
107
policy_arn = var. role_policy_arns [count . index ]
108
108
}
Original file line number Diff line number Diff line change @@ -65,6 +65,6 @@ resource "aws_iam_role" "this" {
65
65
resource "aws_iam_role_policy_attachment" "custom" {
66
66
count = var. create_role ? local. number_of_role_policy_arns : 0
67
67
68
- role = join ( " " , aws_iam_role. this . * . name )
68
+ role = aws_iam_role. this [ 0 ] . name
69
69
policy_arn = var. role_policy_arns [count . index ]
70
70
}
Original file line number Diff line number Diff line change 1
1
locals {
2
- group_name = element ( concat ( aws_iam_group. this . * . id , [ var . name ]), 0 )
2
+ group_name = var . create_group ? aws_iam_group. this [ 0 ] . id : var. name
3
3
}
4
4
5
5
resource "aws_iam_group" "this" {
@@ -37,7 +37,7 @@ resource "aws_iam_group_policy_attachment" "custom" {
37
37
count = length (var. custom_group_policies )
38
38
39
39
group = local. group_name
40
- policy_arn = element (aws_iam_policy. custom . * . arn , count. index )
40
+ policy_arn = element (aws_iam_policy. custom [ * ] . arn , count. index )
41
41
}
42
42
43
43
# ##############
Original file line number Diff line number Diff line change @@ -5,13 +5,7 @@ data "aws_caller_identity" "current" {
5
5
data "aws_partition" "current" {}
6
6
7
7
locals {
8
- aws_account_id = element (
9
- concat (
10
- data. aws_caller_identity . current . * . account_id ,
11
- [var . aws_account_id ],
12
- ),
13
- 0 ,
14
- )
8
+ aws_account_id = try (data. aws_caller_identity . current [0 ]. account_id , var. aws_account_id )
15
9
}
16
10
17
11
data "aws_iam_policy_document" "iam_self_management" {
Original file line number Diff line number Diff line change @@ -82,9 +82,9 @@ data "aws_iam_policy_document" "logs_query" {
82
82
data "aws_iam_policy_document" "combined" {
83
83
source_policy_documents = concat (
84
84
[data . aws_iam_policy_document . allowed_services . json ],
85
- data. aws_iam_policy_document . console_services . * . json ,
86
- data. aws_iam_policy_document . sts . * . json ,
87
- data. aws_iam_policy_document . logs_query . * . json ,
85
+ data. aws_iam_policy_document . console_services [ * ] . json ,
86
+ data. aws_iam_policy_document . sts [ * ] . json ,
87
+ data. aws_iam_policy_document . logs_query [ * ] . json ,
88
88
[var . additional_policy_json ]
89
89
)
90
90
}
You can’t perform that action at this time.
0 commit comments