Fix domains of default service accounts when universe is present (#3670)

This commit is contained in:
Julio Castillo
2026-01-23 15:11:17 +01:00
committed by GitHub
parent 1e82683b15
commit 8dde9fe773
4 changed files with 44 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2025 Google LLC
* Copyright 2026 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -125,6 +125,23 @@ locals {
try(var.project_reuse.attributes.services_enabled, [])
)) : s if !contains(local._u_unavailable_si, s)
]
default_service_accounts = (
var.universe == null
? {
compute = "${local.project.number}-compute@developer.gserviceaccount.com"
gae = "${local.project.project_id}@appspot.gserviceaccount.com"
}
: {
compute = "${local.project.number}-compute@developer.${local._u_domain}iam.gserviceaccount.com"
gae = format(
"%s@appspot.%siam.gserviceaccount.com",
trimprefix(local.project.project_id, "${var.universe.prefix}:"),
local._u_domain
)
}
)
}
data "google_storage_project_service_account" "gcs_sa" {