@@ -44,7 +44,7 @@ func (r *ServiceAccountFederatedIdentityProviderResource) Metadata(_ context.Con
4444 resp .TypeName = req .ProviderTypeName + "_service_account_federated_identity_provider"
4545}
4646
47- func (r * ServiceAccountFederatedIdentityProviderResource ) Schema (_ context.Context , req resource.SchemaRequest , resp * resource.SchemaResponse ) {
47+ func (r * ServiceAccountFederatedIdentityProviderResource ) Schema (_ context.Context , _ resource.SchemaRequest , resp * resource.SchemaResponse ) {
4848 descriptions := map [string ]string {
4949 "id" : "Terraform's internal resource identifier. It is structured as \" `project_id`,`service_account_email`,`federation_id`\" ." ,
5050 "main" : "Service account federated identity provider schema." ,
@@ -340,17 +340,24 @@ func mapFields(ctx context.Context, apiResp *serviceaccount.FederatedIdentityPro
340340 if apiResp == nil {
341341 return fmt .Errorf ("apiResp is nil" )
342342 }
343- model .Id = utils .BuildInternalTerraformId (projectId , serviceAccountEmail , * apiResp .Id )
343+
344+ federationId := ""
345+ if apiResp .Id != nil {
346+ federationId = * apiResp .Id
347+ }
348+ model .Id = utils .BuildInternalTerraformId (projectId , serviceAccountEmail , federationId )
344349 model .ProjectId = types .StringValue (projectId )
345350 model .ServiceAccountEmail = types .StringValue (serviceAccountEmail )
346- if apiResp . Id != nil {
347- model .FederationId = types .StringValue (* apiResp . Id )
351+ if federationId != "" {
352+ model .FederationId = types .StringValue (federationId )
348353 } else {
349354 model .FederationId = types .StringNull ()
350355 }
351356
352357 if apiResp .Name != "" {
353358 model .Name = types .StringValue (apiResp .Name )
359+ } else {
360+ model .Name = types .StringNull ()
354361 }
355362
356363 if apiResp .Issuer != "" {
0 commit comments