File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ resource "aws_iam_role" "this" {
73
73
# #############################
74
74
75
75
data "aws_iam_policy_document" "service" {
76
- for_each = local. create_role && var. attach_policies_for_integrations ? var. service_integrations : tomap ({})
76
+ for_each = local. create_role && var. attach_policies_for_integrations ? try ( tomap ( var. service_integrations ), var . service_integrations ) : tomap ({})
77
77
78
78
dynamic "statement" {
79
79
for_each = each. value
@@ -97,14 +97,14 @@ data "aws_iam_policy_document" "service" {
97
97
}
98
98
99
99
resource "aws_iam_policy" "service" {
100
- for_each = local. create_role && var. attach_policies_for_integrations ? var. service_integrations : tomap ({})
100
+ for_each = local. create_role && var. attach_policies_for_integrations ? try ( tomap ( var. service_integrations ), var . service_integrations ) : tomap ({})
101
101
102
102
name = " ${ local . role_name } -${ each . key } "
103
103
policy = data. aws_iam_policy_document . service [each . key ]. json
104
104
}
105
105
106
106
resource "aws_iam_policy_attachment" "service" {
107
- for_each = local. create_role && var. attach_policies_for_integrations ? var. service_integrations : tomap ({})
107
+ for_each = local. create_role && var. attach_policies_for_integrations ? try ( tomap ( var. service_integrations ), var . service_integrations ) : tomap ({})
108
108
109
109
name = " ${ local . role_name } -${ each . key } "
110
110
roles = [aws_iam_role . this [0 ]. name ]
You can’t perform that action at this time.
0 commit comments