diff --git a/modules/folder/organization-policies.tf b/modules/folder/organization-policies.tf index 2bf79c4ab6..90d45ff01d 100644 --- a/modules/folder/organization-policies.tf +++ b/modules/folder/organization-policies.tf @@ -19,7 +19,7 @@ locals { _factory_data_raw = merge([ for f in try(fileset(var.org_policies_data_path, "*.yaml"), []) : - yamldecode(file("${var.org_policies_data_path}/${f}")) + try(yamldecode(file("${var.org_policies_data_path}/${f}")), {}) ]...) # simulate applying defaults to data coming from yaml files diff --git a/modules/organization/organization-policies.tf b/modules/organization/organization-policies.tf index 8d867f668c..602e72305b 100644 --- a/modules/organization/organization-policies.tf +++ b/modules/organization/organization-policies.tf @@ -19,7 +19,7 @@ locals { _factory_data_raw = merge([ for f in try(fileset(var.org_policies_data_path, "*.yaml"), []) : - yamldecode(file("${var.org_policies_data_path}/${f}")) + try(yamldecode(file("${var.org_policies_data_path}/${f}")), {}) ]...) # simulate applying defaults to data coming from yaml files diff --git a/modules/project/organization-policies.tf b/modules/project/organization-policies.tf index 37e6f2531f..e4f10ddaae 100644 --- a/modules/project/organization-policies.tf +++ b/modules/project/organization-policies.tf @@ -19,7 +19,7 @@ locals { _factory_data_raw = merge([ for f in try(fileset(var.org_policies_data_path, "*.yaml"), []) : - yamldecode(file("${var.org_policies_data_path}/${f}")) + try(yamldecode(file("${var.org_policies_data_path}/${f}")), {}) ]...) # simulate applying defaults to data coming from yaml files