File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 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" {
7373# #############################
7474
7575data "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 ({})
7777
7878 dynamic "statement" {
7979 for_each = each. value
@@ -97,14 +97,14 @@ data "aws_iam_policy_document" "service" {
9797}
9898
9999resource "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 ({})
101101
102102 name = " ${ local . role_name } -${ each . key } "
103103 policy = data. aws_iam_policy_document . service [each . key ]. json
104104}
105105
106106resource "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 ({})
108108
109109 name = " ${ local . role_name } -${ each . key } "
110110 roles = [aws_iam_role . this [0 ]. name ]
You can’t perform that action at this time.
0 commit comments