From 7d5501532e3b6028a59d0315c3aa6a55406a1779 Mon Sep 17 00:00:00 2001 From: Icerzack Date: Thu, 21 Mar 2024 18:39:38 +0300 Subject: [PATCH] add default auth_region --- selectel/iam.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(),