Celeb Glow
updates | March 24, 2026

How do I get a list of Amazon regions via the command line?

I'd like to see how I can get a list of regions from AWS on the command line so I can quickly look things up, how can I do this?

3 Answers

This is now how you'd do it using the aws cli:

$ aws ec2 describe-regions --output table
----------------------------------------------------------
| DescribeRegions |
+--------------------------------------------------------+
|| Regions ||
|+-----------------------------------+------------------+|
|| Endpoint | RegionName ||
|+-----------------------------------+------------------+|
|| ec2.eu-west-1.amazonaws.com | eu-west-1 ||
|| ec2.ap-southeast-1.amazonaws.com | ap-southeast-1 ||
|| ec2.ap-southeast-2.amazonaws.com | ap-southeast-2 ||
|| ec2.eu-central-1.amazonaws.com | eu-central-1 ||
|| ec2.ap-northeast-2.amazonaws.com | ap-northeast-2 ||
|| ec2.ap-northeast-1.amazonaws.com | ap-northeast-1 ||
|| ec2.us-east-1.amazonaws.com | us-east-1 ||
|| ec2.sa-east-1.amazonaws.com | sa-east-1 ||
|| ec2.us-west-1.amazonaws.com | us-west-1 ||
|| ec2.us-west-2.amazonaws.com | us-west-2 ||
|+-----------------------------------+------------------+|

You can do this by running the command ec2-describe-regions from the command line (if you have ec2-api-tools installed available in multiverse).

$ ec2-describe-regions
REGION eu-west-1 ec2.eu-west-1.amazonaws.com
REGION sa-east-1 ec2.sa-east-1.amazonaws.com
REGION us-east-1 ec2.us-east-1.amazonaws.com
REGION ap-northeast-1 ec2.ap-northeast-1.amazonaws.com
REGION us-west-2 ec2.us-west-2.amazonaws.com
REGION us-west-1 ec2.us-west-1.amazonaws.com
REGION ap-southeast-1 ec2.ap-southeast-1.amazonaws.com
3

Botocore would have all of them in configured endpoints:

$ curl -s | grep -B1 desc|grep {|cut -d \" -f2

Your AWS CLI installation may have it locally; In this example, I get at it with python:

$ python3 << :]
> #!/usr/bin/env python3.7
>
> import botocore, json
> from pathlib import Path
>
> with open("{}/{}".format(Path(botocore.__file__).resolve().parent, "data/endpoints.json"), 'r') as e:
> for p in json.load(e)['partitions']:
> print("{}:\t\t{}".format(p['partitionName']," ".join(p['regions'].keys())))
> :]
AWS Standard: af-south-1 ap-east-1 ap-northeast-1 ap-northeast-2 ap-northeast-3 ap-south-1 ap-southeast-1 ap-southeast-2 ap-southeast-3 ca-central-1 eu-central-1 eu-north-1 eu-south-1 eu-west-1 eu-west-2 eu-west-3 me-south-1 sa-east-1 us-east-1 us-east-2 us-west-1 us-west-2
AWS China: cn-north-1 cn-northwest-1
AWS GovCloud (US): us-gov-east-1 us-gov-west-1
AWS ISO (US): us-iso-east-1 us-iso-west-1
AWS ISOB (US): us-isob-east-1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy