Pathexpand all factory data paths (#3033)

* Pathexpand all factory data paths

* fix net monitoring paths

* fix file paths

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
Simone Ruffilli
2025-04-16 13:28:10 +02:00
committed by GitHub
parent 088437fabd
commit c6c4cc71d5
12 changed files with 41 additions and 29 deletions

View File

@@ -20,10 +20,11 @@
# - external users need to have accepted the invitation email to join
locals {
_custom_roles_path = pathexpand(coalesce(var.factories_config.custom_roles, "-"))
_custom_roles = {
for f in try(fileset(var.factories_config.custom_roles, "*.yaml"), []) :
for f in try(fileset(local._custom_roles_path, "*.yaml"), []) :
replace(f, ".yaml", "") => yamldecode(
file("${var.factories_config.custom_roles}/${f}")
file("${local._custom_roles_path}/${f}")
)
}
_iam_principal_roles = distinct(flatten(values(var.iam_by_principals)))