support all region vpc endpoint
@@ -203,21 +203,19 @@ func updateEcsClent(client *ecs.Client) *ecs.Client {
func SetEcsEndPoint(regionID string) {
// use unitized region endpoint for blew regions.
// total 19 regions
+ isEndpointSet := false
unitizedRegions := []string{"cn-hangzhou", "cn-zhangjiakou", "cn-huhehaote", "cn-shenzhen", "ap-southeast-1", "ap-southeast-2",
"ap-southeast-3", "ap-southeast-5", "eu-central-1", "us-east-1", "cn-hongkong", "ap-northeast-1", "ap-south-1",
"us-west-1", "me-east-1", "cn-north-2-gov-1", "eu-west-1", "cn-chengdu"}
for _, tmpRegion := range unitizedRegions {
if regionID == tmpRegion {
aliyunep.AddEndpointMapping(regionID, "Ecs", "ecs."+regionID+".aliyuncs.com")
+ isEndpointSet = true
break
}
}
- unitizedRegionsVpc := []string{"cn-beijing", "cn-shanghai", "cn-hongkong", "me-east-1", "cn-shenzhen-finance-1", "cn-shanghai-finance-1", "cn-qingdao"}
- for _, tmpRegion := range unitizedRegionsVpc {
- if regionID == tmpRegion {
+ if isEndpointSet == false {
aliyunep.AddEndpointMapping(regionID, "Ecs", "ecs-vpc."+regionID+".aliyuncs.com")
- break
- }
}
// use environment endpoint setting first;
