diff --git a/selectel/iam.go b/selectel/iam.go index b0a19164..0cf3bfa3 100644 --- a/selectel/iam.go +++ b/selectel/iam.go @@ -24,11 +24,15 @@ func getIAMClient(meta interface{}) (*iam.Client, diag.Diagnostics) { if err != nil { return nil, diag.FromErr(fmt.Errorf("can't get selvpc client for iam: %w", err)) } + + if config.AuthRegion == "" { + config.AuthRegion = "ru-1" + } + apiURL, err := getEndpointForIAM(selvpcClient, config.AuthRegion) if err != nil { return nil, diag.FromErr(err) } - iamClient, err := iam.New( iam.WithAuthOpts(&iam.AuthOpts{ KeystoneToken: selvpcClient.GetXAuthToken(),