diff --git a/mmv1/third_party/terraform/fwtransport/framework_config.go.tmpl b/mmv1/third_party/terraform/fwtransport/framework_config.go.tmpl index 4312bbad172d..fac8a10d3944 100644 --- a/mmv1/third_party/terraform/fwtransport/framework_config.go.tmpl +++ b/mmv1/third_party/terraform/fwtransport/framework_config.go.tmpl @@ -529,20 +529,6 @@ func RemoveBasePathVersion(url string) string { return re.ReplaceAllString(url, "$1/") } -func (p *FrameworkProviderConfig) NewIamCredentialsClient(userAgent string) *iamcredentials.Service { - iamCredentialsClientBasePath := RemoveBasePathVersion(p.IAMCredentialsBasePath) - log.Printf("[INFO] Instantiating Google Cloud IAMCredentials client for path %s", iamCredentialsClientBasePath) - clientIamCredentials, err := iamcredentials.NewService(p.Context, option.WithHTTPClient(p.Client)) - if err != nil { - log.Printf("[WARN] Error creating client iam credentials: %s", err) - return nil - } - clientIamCredentials.UserAgent = userAgent - clientIamCredentials.BasePath = iamCredentialsClientBasePath - - return clientIamCredentials -} - func (p *FrameworkProviderConfig) logGoogleIdentities(ctx context.Context, data fwmodels.ProviderModel, diags *diag.Diagnostics) { // GetCurrentUserEmailFramework doesn't pass an error back from logGoogleIdentities, so we want // a separate diagnostics here diff --git a/mmv1/third_party/terraform/fwtransport/framework_provider_clients.go.tmpl b/mmv1/third_party/terraform/fwtransport/framework_provider_clients.go.tmpl index 1001fa557202..bf2cb7804266 100644 --- a/mmv1/third_party/terraform/fwtransport/framework_provider_clients.go.tmpl +++ b/mmv1/third_party/terraform/fwtransport/framework_provider_clients.go.tmpl @@ -37,6 +37,20 @@ func (p *FrameworkProviderConfig) NewDnsClient(userAgent string, diags *diag.Dia return clientDns } +func (p *FrameworkProviderConfig) NewIamCredentialsClient(userAgent string) *iamcredentials.Service { + iamCredentialsClientBasePath := RemoveBasePathVersion(p.IAMCredentialsBasePath) + log.Printf("[INFO] Instantiating Google Cloud IAMCredentials client for path %s", iamCredentialsClientBasePath) + clientIamCredentials, err := iamcredentials.NewService(p.Context, option.WithHTTPClient(p.Client)) + if err != nil { + log.Printf("[WARN] Error creating client iam credentials: %s", err) + return nil + } + clientIamCredentials.UserAgent = userAgent + clientIamCredentials.BasePath = iamCredentialsClientBasePath + + return clientIamCredentials +} + {{ if ne $.TargetVersionName `ga` -}} func (p *FrameworkProviderConfig) NewFirebaseClient(userAgent string, diags *diag.Diagnostics) *firebase.Service { firebaseClientBasePath := transport_tpg.RemoveBasePathVersion(p.FirebaseBasePath)