Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/services/cloud-bench-workload-identity/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ data "google_projects" "all_projects" {
filter = "parent.id:${data.google_organization.org.org_id} parent.type:organization lifecycleState:ACTIVE"
}

data "google_project" "project" {
for_each = {
for project_id in local.project_ids : project_id => project_id
}
project_id = each.key
}

locals {
# If specific projects are specified, use that list. Otherwise, use all active projects in the org
project_ids = length(var.project_ids) == 0 ? [for p in data.google_projects.all_projects.projects : p.project_id] : var.project_ids

# Fetch both the project ID and project number (Needed by Workload Identity Federation)
project_id_to_number_map = { for p in data.google_projects.all_projects.projects : p.project_id => p.number }
project_id_to_number_map = { for project_id, project in data.google_project.project : project_id => project.number }
}

module "trust_relationship" {
Expand Down