Regions
A region is one area of the world where AWS runs, like Mumbai. Regions have different prices and offer different services. You learn to choose the right region in a simple order: close to your users, allowed by law, has the services you need - and only then the cheapest.
What you will be able to do
- Explain what makes regions independent
- Compare the price of the same server across all regions
- Check which services a region offers - and how reliable each source is
- Spot a missing service before it breaks a feature
- Choose a region with a clear checklist
The idea, in plain English
A region is a separate copy of AWS in one part of the world: its own data centres, its own network, its own copy of each service. Regions are isolated on purpose - a problem in one should not spread to another, and nothing moves between them unless you move it. That is why every resource you create belongs to exactly one region (Lesson 2) and why "where" matters (Lesson 3).
Regions are not all the same. Prices differ, because land, power and taxes differ. And not every service exists everywhere: AWS opens new services in its biggest regions first, and new regions start with fewer services. So "the closest region" is not automatically the right one.
We compare regions with real data and no account: AWS’s public price lists for all 34 regions, boto3’s built-in list of services per region, AWS’s own regional services table, and a DNS lookup that shows what "a service does not exist in this region" means. boto3 1.44.4, Python 3.13.12; prices published 2026-11-14.
Worked example: An Indian online shop chooses between Mumbai and Hyderabad: the same server priced in every region, the services each region offers, and a photo-checking feature that only one of the two can run.
Words you will see in this lesson
A few region words.
Region codeThe short name used in code and the CLI: ap-south-1.IsolatedSeparate on purpose: a failure or a change in one region stays there.On-demand priceThe normal hourly price with no commitment (Lesson 1).Opt-in regionA newer region that is switched off in a new account until you enable it.EndpointThe internet address of a service in a region: rekognition.ap-south-1.amazonaws.com.ComplianceFollowing laws and rules about data - for example, where it may be stored.An everyday example: opening a new shop branch
A bakery chain picks a city for its next branch. It asks four questions:
- Customers: is it close to the people who will buy? (latency)
- Rules: may we sell here, and what do we have to keep local? (law)
- Suppliers: does our flour supplier deliver to this city? (services)
- Rent: how much does the shop space cost? (price)
- A cheap city with no flour supplier is no good - the order of the questions matters. Choosing an AWS region is the same.
What makes a region a region
- Each region has its own availability zones (Lesson 5), its own network, and its own copy of each service.
- Resources stay where you create them. A server in Mumbai is not visible in Singapore (Lesson 2’s "missing" orders).
- Each region has its own prices and its own list of services.
- Regions opened since 2019 - Hyderabad among them - are opt-in: a new account must enable them before use. Older ones like Mumbai are on by default.
- You can use many regions from one account, but each is set up separately.
Example 1 - the same server in every region
all_prices.py downloads AWS’s public price list for each of the 34 regions (no account) and saves the t3.medium price. compare_prices.py ranks them:
- The region names come from boto3’s built-in list (Lesson 3). The price files use "EU (...)" where boto3 says "Europe (...)", so the script changes that one word.
- The files are sent gzip-compressed - the script unpacks them. (curl did this for us in Lesson 1 with --compressed.)
- compare_prices.py prints the cheapest 3, the most expensive 3, and our two Indian regions, with the monthly cost of a small shop: 4 servers for 720 hours.
import gzip
import json
import urllib.parse
import urllib.request
from botocore.loaders import Loader
BASE = "https://b0.p.awsstatic.com/pricing/2.0/meteredUnitMaps/ec2/USD/current/ec2-ondemand-without-sec-sel/{}/Linux/index.json"
regions = Loader().load_data("endpoints")["partitions"][0]["regions"] # the main "aws" partition
prices, missing = {}, []
for code, info in regions.items():
name = info["description"].replace("Europe (", "EU (") # the price list says "EU (...)"
try:
with urllib.request.urlopen(BASE.format(urllib.parse.quote(name)), timeout=20) as r:
data = json.loads(gzip.decompress(r.read())) # the files are sent gzip-compressed
rows = next(iter(data["regions"].values())).values()
prices[code] = (info["description"], float(next(x["price"] for x in rows if x["Instance Type"] == "t3.medium")))
except Exception as error:
missing.append(f"{code} ({type(error).__name__})")
json.dump(prices, open("prices_t3_medium.json", "w"), indent=1)
print("regions priced:", len(prices), "| no price found:", missing)import json
prices = json.load(open("prices_t3_medium.json")) # made by all_prices.py
ranked = sorted(prices.items(), key=lambda item: item[1][1])
SERVERS, HOURS = 4, 720 # a small shop: 4 servers, one month
def line(rank, code):
name, price = prices[code]
return f"{rank:>2}. {code:<15} {name:<28} ${price:.4f}/hour 4 servers: ${price * SERVERS * HOURS:7.2f}/month"
print("t3.medium on-demand, Linux - cheapest 3:")
for rank, (code, _) in enumerate(ranked[:3], 1):
print(line(rank, code))
print("most expensive 3:")
for rank, (code, _) in enumerate(ranked[-3:], len(ranked) - 2):
print(line(rank, code))
print("near our users:")
for code in ["ap-south-1", "ap-south-2"]:
print(line([c for c, _ in ranked].index(code) + 1, code))
cheapest, dearest = ranked[0][1][1], ranked[-1][1][1]
print(f"\nsame server, most expensive region / cheapest region = {dearest / cheapest:.2f}x")$ python all_prices.py
regions priced: 34 | no price found: []
$ python compare_prices.py
t3.medium on-demand, Linux - cheapest 3:
1. us-east-1 US East (N. Virginia) $0.0416/hour 4 servers: $ 119.81/month
2. us-east-2 US East (Ohio) $0.0416/hour 4 servers: $ 119.81/month
3. us-west-2 US West (Oregon) $0.0416/hour 4 servers: $ 119.81/month
most expensive 3:
32. ap-southeast-6 Asia Pacific (New Zealand) $0.0554/hour 4 servers: $ 159.55/month
33. ap-east-1 Asia Pacific (Hong Kong) $0.0584/hour 4 servers: $ 168.19/month
34. sa-east-1 South America (Sao Paulo) $0.0672/hour 4 servers: $ 193.54/month
near our users:
6. ap-south-1 Asia Pacific (Mumbai) $0.0448/hour 4 servers: $ 129.02/month
7. ap-south-2 Asia Pacific (Hyderabad) $0.0448/hour 4 servers: $ 129.02/month
same server, most expensive region / cheapest region = 1.62xReading the prices
- The three US regions are the cheapest: $0.0416 per hour, $119.81 a month for 4 servers.
- São Paulo is the most expensive: $0.0672 per hour, $193.54 a month - 1.62 times as much for exactly the same server.
- Mumbai and Hyderabad cost the same: $0.0448 per hour, $129.02 a month, 6th and 7th of 34.
- Lesson 3 showed why the cheapest region is often wrong: the US regions are far from Indian users. Price is the LAST question, not the first.
- Other services have their own price differences - always check the service you will use most.
Example 2 - which services does a region offer?
services_by_region.py asks boto3 which regions each of its 439 services runs in, then counts per region:
- N. Virginia, the oldest region: 297 services. Mumbai: 233. Hyderabad, opened in 2022: 150.
- All the core web-app services from Lesson 2 exist in all three regions.
- Rekognition (image analysis - for example, checking product photos) is missing in Hyderabad.
- bedrock-runtime (Amazon Bedrock, for AI models) shows as missing everywhere. That is wrong - see the next section.
import boto3
session = boto3.session.Session()
services = session.get_available_services() # 439 services (Lesson 2)
REGIONS = ["us-east-1", "ap-south-1", "ap-south-2"]
offered = {region: set() for region in REGIONS}
for service in services:
regions = session.get_available_regions(service)
for region in REGIONS:
if region in regions:
offered[region].add(service)
for region in REGIONS:
print(f"{region:<11} offers {len(offered[region]):>3} services")
# The services from Lesson 2's web-app table, plus two popular AI services
WANTED = ["ec2", "ecs", "lambda", "rds", "dynamodb", "s3", "elasticache", "sqs", "sns",
"secretsmanager", "cloudwatch", "elbv2", "bedrock-runtime", "sagemaker", "rekognition"]
print("\nservice " + "".join(f"{r:>12}" for r in REGIONS))
for service in WANTED:
print(f"{service:<17}" + "".join(f"{'yes' if service in offered[r] else '-- missing':>12}" for r in REGIONS))us-east-1 offers 297 services
ap-south-1 offers 233 services
ap-south-2 offers 150 services
service us-east-1 ap-south-1 ap-south-2
ec2 yes yes yes
ecs yes yes yes
lambda yes yes yes
rds yes yes yes
dynamodb yes yes yes
s3 yes yes yes
elasticache yes yes yes
sqs yes yes yes
sns yes yes yes
secretsmanager yes yes yes
cloudwatch yes yes yes
elbv2 yes yes yes
bedrock-runtime -- missing -- missing -- missing
sagemaker yes yes yes
rekognition yes yes -- missingCheck the source: boto3’s list is not complete
Bedrock definitely runs in N. Virginia, yet boto3 said "missing". cross_check.py compares boto3 with AWS’s own regional services table - the public data behind AWS’s "Regional Services" web page:
- Lambda: both sources agree - all three regions.
- Rekognition: both agree - missing in Hyderabad. That one is real.
- Bedrock: boto3 says missing everywhere, AWS’s table says yes in all three. boto3’s old region list does not cover some newer services.
- The AWS table has its own warning: "intended for use only on aws.amazon.com. We do not guarantee its availability or accuracy" - and its version stamp is from November 2025.
- So never trust one list. For a service that matters, confirm in the AWS console of that region before you decide.
import json
import boto3
# AWS's public "which service runs where" table (the data behind its Regional Services page):
# curl --compressed -o regional_table.json "https://api.regional-table.region-services.aws.a2z.com/index.json"
table = {(row["attributes"]["aws:serviceName"], row["attributes"]["aws:region"])
for row in json.load(open("regional_table.json"))["prices"]}
session = boto3.session.Session()
CHECK = {"lambda": "AWS Lambda", "rekognition": "Amazon Rekognition", "bedrock-runtime": "Amazon Bedrock"}
REGIONS = ["us-east-1", "ap-south-1", "ap-south-2"]
print(f"{'service':<17}{'source':<12}" + "".join(f"{r:>12}" for r in REGIONS))
for boto_name, aws_name in CHECK.items():
boto_regions = session.get_available_regions(boto_name)
print(f"{boto_name:<17}{'boto3':<12}" + "".join(f"{'yes' if r in boto_regions else 'missing':>12}" for r in REGIONS))
print(f"{'':<17}{'AWS table':<12}" + "".join(f"{'yes' if (aws_name, r) in table else 'missing':>12}" for r in REGIONS))service source us-east-1 ap-south-1 ap-south-2
lambda boto3 yes yes yes
AWS table yes yes yes
rekognition boto3 yes yes missing
AWS table yes yes missing
bedrock-runtime boto3 missing missing missing
AWS table yes yes yesTrap: the closest region does not have your service
Our shop wants the closest region - Hyderabad, 8 ms away (Lesson 3) - and checks every uploaded product photo with Rekognition. call_missing.py asks the internet for Rekognition’s address in both regions:
- Mumbai: rekognition.ap-south-1.amazonaws.com has an address and answers (HTTP 404 - no path and no login, but the service is there).
- Hyderabad: rekognition.ap-south-2.amazonaws.com - no such address. The service does not exist there; the photo feature would fail on its first call.
- Before: choose by distance alone - the feature breaks. After: check services first - Mumbai has everything the shop needs, at the same price, 22 ms away.
- Another fix: keep the app in Hyderabad and call Rekognition in Mumbai. It works, but every call now crosses regions - more time, and data transfer between regions is charged.
import socket
import urllib.error
import urllib.request
# Every AWS service has an address per region: <service>.<region>.amazonaws.com
for region in ["ap-south-1", "ap-south-2"]:
host = f"rekognition.{region}.amazonaws.com"
try:
address = socket.gethostbyname(host)
try:
urllib.request.urlopen(f"https://{host}/", timeout=5)
except urllib.error.HTTPError as answer: # no account, so AWS says "not allowed" - but it answers
print(f"{host:<36} -> {address:<15} answers HTTP {answer.code}")
except socket.gaierror as error:
print(f"{host:<36} -> no such address ({error.strerror})")rekognition.ap-south-1.amazonaws.com -> 52.66.145.24 answers HTTP 404
rekognition.ap-south-2.amazonaws.com -> no such address (nodename nor servname provided, or not known)Law first: data residency
- Some data must stay in a country: payment data in India (Lesson 3), personal data under strict rules in the EU, government data in special regions (GovCloud).
- AWS does not move your data between regions by itself. If you copy it to another region (backups, replicas), that copy counts too.
- Check this with whoever owns the rules in your company before you build - moving a running system to another region later is a big project.
The checklist
For every new app, answer in this order and write the answers down:
- 1. Users: which region is closest to most of them? Measure (Lesson 3).
- 2. Law: must the data stay in a country?
- 3. Services: does the region offer every service you need? Check the console, not just one list.
- 4. Price: compare the services you will use most.
- 5. Later: do you need a second region for disaster recovery (Lesson 184)?
Regions at a glance
Price of a serverPublic, no account.
https://b0.p.awsstatic.com/pricing/2.0/meteredUnitMaps/ec2/USD/current/ec2-ondemand-without-sec-sel/<Region name>/Linux/index.json
Services per region (boto3)Offline; incomplete for newer services.
session.get_available_regions("rekognition")Services per region (AWS)Public table, no guarantee.
https://api.regional-table.region-services.aws.a2z.com/index.json
Service addressPer region.
rekognition.ap-south-1.amazonaws.com
ChooseIn this order.
users -> law -> services -> price
Try it yourself
The code does not change. Swap the content string and the program does something else entirely.
“Change compare_prices.py (and all_prices.py) to m5.large. Is the spread between regions bigger or smaller?”
“Add a service you plan to use to CHECK in cross_check.py. Do both sources agree?”
“Find one more service that Mumbai offers and Hyderabad does not, using services_by_region.py.”
“Add ap-southeast-1 to REGIONS in services_by_region.py. How many services does it offer?”
What usually goes wrong
The US regions are cheapest ($0.0416) and far from Indian users.
Rekognition does not exist in Hyderabad - the photo feature would fail.
boto3 said Bedrock was missing everywhere; AWS’s table said it was available.
Newer regions like Hyderabad must be enabled in the account before use.
Calling a service in another region adds time, and data transfer between regions is charged.
Best practices
- Decide in this order: users, law, services, price.
- Confirm every needed service in the region’s console before committing.
- Keep one app’s parts in one region; cross regions only on purpose.
- Write the region choice and its reasons down for the team.
Practice
Write these yourself before opening anything. Getting them wrong first is most of how this sticks.
Write choose_region.py: given a list of required services (boto3 names) and a list of candidate regions ordered by distance, print the first region that offers ALL of them (using boto3’s list), and for each skipped region print which service was missing. Test it with ["ec2", "s3", "rekognition"] and ["ap-south-2", "ap-south-1"].
Show hintHide hint
Build a set of regions per service with session.get_available_regions(service), then check each candidate in order.
A region report for your project
Write a one-page region decision for an app you want to build, backed by numbers you produced in this lesson.
- Name your users’ location and the two closest regions.
- State any data rule that applies (or "none known").
- List the services you need and confirm each in two sources.
- Compare the monthly price of your main server type in both regions.
- Give your choice and the one reason that decided it.
Key points
- Regions are isolated copies of AWS; every resource lives in one.
- The same t3.medium costs $0.0416 to $0.0672 per hour - 1.62x - depending on the region.
- Regions offer different services: 297 in us-east-1, 233 in ap-south-1, 150 in ap-south-2.
- Rekognition is missing in Hyderabad: its address does not exist there.
- boto3’s service list is incomplete for newer services - check more than one source.
Quick check before you move on
Interview questions
What factors do you consider when choosing an AWS region?
Latency to users, data residency and compliance, availability of the services you need, price, and disaster recovery needs (a second region).
Are all AWS services available in every region?
No - availability varies; new services launch in a few regions first and newer regions start with fewer services, so you verify per region before designing.
What are opt-in regions?
Regions launched since 2019 that are disabled by default in an account; an administrator must enable them before resources can be created there.
Quiz
- 1.
Why do prices differ between regions?
- 2.
Why should price be the last question when choosing a region?
- 3.
Why did boto3 say Bedrock was missing in every region?
- 4.
What are two ways to handle a service missing from your region?
Comments
Sign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...