我应该如何使用区域获取AWS区域名称 [英] How should i get aws region names using regions

查看:89
本文介绍了我应该如何使用区域获取AWS区域名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想使用region手段来获取Amazon Web Services(aws)的区域名称

Hi I want to get the amazon web services(aws) region names using regions means

   region is "us-east-1" region name is "US East (N. Virginia)"
   region is "us-west-2" region name is "US West (Oregon)"

使用us-east-1区域,我要动态显示区域名称美国东部(弗吉尼亚北部)".

using us-east-1 region i want to display region name "US East (N. Virginia)" dynamically.

谢谢 桑杰

推荐答案

没有可调用的AWS API方法来获取此信息.

There isn't an AWS API method to call to get this information.

某些SDK(例如适用于.NET的AWS开发工具包)已将这些信息烘焙到SDK中.例如,在C#中:

Some SDKs, such as the AWS SDK for .NET has this information baked into the SDK. For example, in C#:

var regions = Amazon.RegionEndpoint.EnumerableAllRegions;
foreach (var r in regions)
{
  Console.WriteLine("{0} -> {1}", r.SystemName, r.DisplayName);
}

浏览适用于Java的AWS开发工具包的文档,我是没有找到一个等效的.如果在那里,我认为它应该在com.amazonaws.regions.Region类上.

Looking through the docs for the AWS SDK for Java, I am not finding an equivalent. If it were there, I would think it should be on the com.amazonaws.regions.Region class.

您可能必须创建自己的映射.

You may have to create your own mapping.

这篇关于我应该如何使用区域获取AWS区域名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆