diff --git a/mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl b/mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl index 8462c33c6f41..7071bf4aed10 100644 --- a/mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl +++ b/mmv1/third_party/terraform/acctest/bootstrap_test_utils.go.tmpl @@ -738,10 +738,11 @@ func BootstrapConfig(t *testing.T) *transport_tpg.Config { } config := &transport_tpg.Config{ - Credentials: envvar.GetTestCredsFromEnv(), - Project: envvar.GetTestProjectFromEnv(), - Region: envvar.GetTestRegionFromEnv(), - Zone: envvar.GetTestZoneFromEnv(), + Credentials: envvar.GetTestCredsFromEnv(), + ImpersonateServiceAccount: envvar.GetTestImpersonateServiceAccountFromEnv(), + Project: envvar.GetTestProjectFromEnv(), + Region: envvar.GetTestRegionFromEnv(), + Zone: envvar.GetTestZoneFromEnv(), } transport_tpg.ConfigureBasePaths(config) diff --git a/mmv1/third_party/terraform/envvar/envvar_utils.go b/mmv1/third_party/terraform/envvar/envvar_utils.go index 90a866e4d941..1dc4eb6e2b33 100644 --- a/mmv1/third_party/terraform/envvar/envvar_utils.go +++ b/mmv1/third_party/terraform/envvar/envvar_utils.go @@ -104,6 +104,10 @@ var PapDescriptionEnvVars = []string{ "GOOGLE_PUBLIC_AVERTISED_PREFIX_DESCRIPTION", } +var ImpersonateServiceAccountEnvVars = []string{ + "GOOGLE_IMPERSONATE_SERVICE_ACCOUNT", +} + // AccTestPreCheck ensures at least one of the project env variables is set. func GetTestProjectNumberFromEnv() string { return transport_tpg.MultiEnvSearch(ProjectNumberEnvVars) @@ -138,6 +142,10 @@ func GetTestZoneFromEnv() string { return transport_tpg.MultiEnvSearch(ZoneEnvVars) } +func GetTestImpersonateServiceAccountFromEnv() string { + return transport_tpg.MultiEnvSearch(ImpersonateServiceAccountEnvVars) +} + func GetTestCustIdFromEnv(t *testing.T) string { SkipIfEnvNotSet(t, CustIdEnvVars...) return transport_tpg.MultiEnvSearch(CustIdEnvVars)