@@ -226,7 +226,7 @@ func resourceMongoDBAtlasPrivateLinkEndpointServiceServerlessImportState(ctx con
226
226
instanceName := parts [1 ]
227
227
endpointID := parts [2 ]
228
228
229
- _ , _ , err := conn .ServerlessPrivateEndpoints .Get (ctx , projectID , instanceName , endpointID )
229
+ privateLinkResponse , _ , err := conn .ServerlessPrivateEndpoints .Get (ctx , projectID , instanceName , endpointID )
230
230
if err != nil {
231
231
return nil , fmt .Errorf ("couldn't import serverless private link endpoint (%s) in projectID (%s) , error: %s" , endpointID , projectID , err )
232
232
}
@@ -238,10 +238,21 @@ func resourceMongoDBAtlasPrivateLinkEndpointServiceServerlessImportState(ctx con
238
238
if err := d .Set ("endpoint_id" , endpointID ); err != nil {
239
239
log .Printf ("[WARN] Error setting endpoint_id for (%s): %s" , endpointID , err )
240
240
}
241
+
241
242
if err := d .Set ("instance_name" , instanceName ); err != nil {
242
243
log .Printf ("[WARN] Error setting instance_name for (%s): %s" , endpointID , err )
243
244
}
244
245
246
+ if privateLinkResponse .PrivateLinkServiceResourceID != "" {
247
+ if err := d .Set ("provider_name" , "AZURE" ); err != nil {
248
+ log .Printf ("[WARN] Error setting provider_name for (%s): %s" , endpointID , err )
249
+ }
250
+ } else {
251
+ if err := d .Set ("provider_name" , "AWS" ); err != nil {
252
+ log .Printf ("[WARN] Error setting provider_name for (%s): %s" , endpointID , err )
253
+ }
254
+ }
255
+
245
256
d .SetId (encodeStateID (map [string ]string {
246
257
"project_id" : projectID ,
247
258
"instance_name" : instanceName ,
0 commit comments