Use project numbers in billing budget filter (#3555)

* Fixed project level billing budget filter

* Moved project_numbers local to concat block

* Fixed with try block

* fix project replacement

* tfdoc

* fix test

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
kovagoadam
2025-12-10 18:35:06 +01:00
committed by GitHub
parent c04c6b8093
commit 4e88bec299
9 changed files with 22 additions and 15 deletions

View File

@@ -98,8 +98,9 @@ resource "google_billing_budget" "default" {
}
projects = concat(
[
for v in each.value.filter.projects :
lookup(local.ctx.project_ids, v, v)
for v in each.value.filter.projects : try(
try("projects/${local.ctx.project_numbers[v]}", v), v
)
],
lookup(local.ctx.project_sets, "$project_sets:${each.key}", [])
)