aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
590 stars 553 forks source link

Change the logic for STS to use region specific endpoint #1603

Closed yokzy88 closed 4 years ago

yokzy88 commented 5 years ago

Hi there, Actually, there is a reliability problem on the aliyun side, especially on the sts endpoint as you can see in the attached screenshot: image

As you can see, the sts.aliyuncs.com is mainland china endpoint, and it is unreliable / intermittently timeout when pinged from my local laptop (I'm in Indonesia). According to Aliyun customer service, they ask to use sts.ap-southeast-5.aliyuncs.com instead, which is more reliable when used from my side.

Therefore this request is to ask to change the logic for STS, which is to adjust the endpoint according to the user region (I use ap-southeast-5 in my terraform region configuration). I believe this will also improve the Terraform performance, because as you can see the ping is also better if we use nearby region endpoint.

Terraform Version

Terraform v0.11.14

Affected Resource(s)

Terraform Configuration Files

data "alicloud_regions" "current_region" { current = true }
provider "alicloud" {
  region    = "ap-southeast-5"
  version   = "1.52.1"
}

Expected Behavior

Terraform executed successfully

Actual Behavior

Terraform got a timeout error image

Important Factoids

xiaozhu36 commented 5 years ago

HI @yokzy88 I am sorry for late reply. This is the provider bug and it will be fixed in the nearly period. And as a workaround, you can set a endpoint sts.ap-southeast-5.aliyuncs.com by provider field sts, like the following:

provider "alicloud" {
  region    = "ap-southeast-5"
  version   = "1.52.1"
  endpoints = {
      sts = "sts.ap-southeast-5.aliyuncs.com"
  }
}
yokzy88 commented 5 years ago

Thanks for the workaround @xiaozhu36. That's new to me.

xiaozhu36 commented 4 years ago

HI @yokzy88 The release 1.57.2 has supported the correct endpoint. Please update and check it.

xiaozhu36 commented 4 years ago

Closed by no reply.