Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should i get aws region names using regions

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)"

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

Thanks Sanjay

like image 534
Sanjay Kumar Avatar asked Jun 24 '16 18:06

Sanjay Kumar


People also ask

How do I find my AWS region name?

To find your Regions using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . From the navigation bar, choose the Regions selector. Your EC2 resources for this Region are displayed on the EC2 Dashboard in the Resources section.

How do I specify AWS region?

Sign in to the AWS Management Console . Choose a service to go to that service's console. In the navigation bar, choose the name of the currently displayed Region. Then choose the Region to which you want to switch.

Is AWS account specific to a region?

AWS originally enabled all new AWS Regions by default, which enabled your users to create resources in any Region. Now, when AWS adds a Region, the new Region is disabled by default. If you want your users to be able to create resources in a new Region, you enable the Region.

Do all AWS regions have 3 availability zones?

There are anywhere between two and five availability zones in an AWS Region. Moving forward, the standard will be three or more per region.


1 Answers

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

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);
}

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.

like image 142
Matt Houser Avatar answered Sep 18 '22 13:09

Matt Houser