阿里云在哪里保存可用区的完整列表?

时间:2018-09-28 21:42:22

标签: alibaba-cloud

阿里云的区域帮助页面为您提供了完整的区域列表。那很有帮助。他们告诉您每个区域有多少个可用区,这也很有帮助。

没有有用的是,他们没有列出每个可用区域的名称。 20分钟的谷歌搜索时间太长,无法花在此上。阿里云/阿里云的可用区域的完整列表在哪里?

2 个答案:

答案 0 :(得分:0)

在撰写本文时,似乎还没有一个容易获得的列表,列出了阿里云所有地区的所有可用区域。要获取完整列表,您需要将其Ali Cloud CLI tool与下拉列表。

它将吐出一堵JSON墙,因此在* nix上并提供jq tool也是很有用的。

给出所有这些,您需要的只是这个简短的shell脚本:

#!/usr/bin/env bash

for region in $( aliyun ecs DescribeRegions | jq '.Regions.Region[].RegionId' )
do
    echo $region
    reg=$( echo $region | sed s/\"//g )
    echo '---'
    for zone in $( aliyun ecs DescribeZones --RegionId $reg | jq '.Zones.Zone[].ZoneId' | sort )
    do
        echo $zone
    done
    echo ''
done

其输出如下。

"cn-qingdao"
---
"cn-qingdao-b"
"cn-qingdao-c"

"cn-beijing"
---
"cn-beijing-a"
"cn-beijing-b"
"cn-beijing-c"
"cn-beijing-d"
"cn-beijing-e"
"cn-beijing-f"
"cn-beijing-g"

"cn-zhangjiakou"
---
"cn-zhangjiakou-a"
"cn-zhangjiakou-b"

"cn-huhehaote"
---
"cn-huhehaote-a"
"cn-huhehaote-b"

"cn-hangzhou"
---
"cn-hangzhou-b"
"cn-hangzhou-c"
"cn-hangzhou-d"
"cn-hangzhou-e"
"cn-hangzhou-f"
"cn-hangzhou-g"
"cn-hangzhou-h"

"cn-shanghai"
---
"cn-shanghai-a"
"cn-shanghai-b"
"cn-shanghai-c"
"cn-shanghai-d"
"cn-shanghai-e"
"cn-shanghai-f"

"cn-shenzhen"
---
"cn-shenzhen-a"
"cn-shenzhen-b"
"cn-shenzhen-c"
"cn-shenzhen-d"

"cn-hongkong"
---
"cn-hongkong-a"
"cn-hongkong-b"
"cn-hongkong-c"

"ap-northeast-1"
---
"ap-northeast-1a"

"ap-southeast-1"
---
"ap-southeast-1a"
"ap-southeast-1b"
"ap-southeast-1c"

"ap-southeast-2"
---
"ap-southeast-2a"
"ap-southeast-2b"

"ap-southeast-3"
---
"ap-southeast-3a"
"ap-southeast-3b"

"ap-southeast-5"
---
"ap-southeast-5a"

"ap-south-1"
---
"ap-south-1a"
"ap-south-1b"

"us-east-1"
---
"us-east-1a"
"us-east-1b"

"us-west-1"
---
"us-west-1a"
"us-west-1b"

"eu-west-1"
---
"eu-west-1a"
"eu-west-1b"

"me-east-1"
---
"me-east-1a"

"eu-central-1"
---
"eu-central-1a"
"eu-central-1b"

答案 1 :(得分:0)

阿里云确实在其网站上提供了有关“每个区域下可用区域的数量以及该特定区域内可用服务”的详细信息。请查看Alibaba Cloud Website