Regions, Availability Zones and how AWS bills you
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Operations and security
-
Phase 3: SQL Server on AWS
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
Every resource you create lives somewhere, and where it lives decides how fast it is, what happens when something fails and how much it costs. This lesson covers AWS regions and availability zones, and then how AWS turns your usage into a bill.
Along the way you’ll write the cleanup script you’ll run at the end of every lab from here on. It looks through every Region for anything tagged for this course, so nothing gets left running by accident.
| Time | You need | By the end you can |
|---|---|---|
| 50 minutes | Your laptop with the AWS CLI from Lesson 3, signed in with aws login --profile saat-root. | Explain Regions, Availability Zones and zone IDs, read the four kinds of AWS charges, tag your resources, and find every tagged lab resource in all Regions with a single script. |
What it is, in one line
AWS regions and availability zones are the “where” of AWS: a Region is an area about the size of a city, and inside each Region sit several separate zones of data centres.
In Simple Words
A bank with branches in one city
Picture a bank in a big city. The city is the Region, and the bank’s three branches in different neighbourhoods are the Availability Zones. Each branch has its own power and its own locks, so if one floods the other two still open, yet they’re close enough that a courier gets from one to another in minutes. You pay the bank for the lockers you rent (storage), for how long you use a meeting room (compute), for each form you fill in (requests) and for every parcel you send out (data transfer).
Engineer's View
How the pieces fit
A Region (for example ap-south-1, Mumbai) is a separate geographic area with its own copy of most AWS services, and your data doesn’t leave it unless you move it. You choose a Region for latency to your users, data laws, which services are available and price, which varies a little from one Region to another.
Each Region has at least three Availability Zones (AZs). A zone is one or more data centres with their own power, cooling and networking, joined to the other zones by fast private links. To survive a zone failure you run copies in two or more zones, and that’s the idea behind the Multi-AZ databases and load balancers you’ll meet in later lessons.
Zone names are per account. Your ap-south-1a might be a different physical zone from someone else’s ap-south-1a. The zone ID (like aps1-az1) is the same for everyone, so go by zone IDs whenever two accounts have to line up.
Regions launched after March 2019, such as Hyderabad (ap-south-2), are opt-in, meaning they stay off until you enable them. The fewer Regions you have switched on, the fewer places there are for someone to hide a resource.
Billing works per account, per month, and it’s built from usage records: compute time, storage per GB-month, request counts and data transfer. Data coming into AWS usually isn’t charged, data going out to the internet is, and data moving between AZs is charged in both directions. Tags (key and value pairs) let you split the bill by project once you’ve activated them as cost allocation tags.
How it works, step by step
This is how location and cost tie together when you build something.
1Pick the Region
Pick it once per project, close to your users, allowed under any data rules, and offering the services you need. This course uses Mumbai.
2Spread across zones
Anything that has to stay up, like web servers and databases, gets at least two copies in two zones, while something for a quick test can sit in a single zone.
3Tag everything
In this course every resource gets course=saatvedha-aws and lesson=NN tags. At work you’d see tags like app, owner, env and cost-centre.
After that AWS meters what you use, and nearly every line on the bill falls into one of these four groups.
4Check and clean up
Check cost by service every week, and after each lab search every Region for anything still tagged. The two costs that creep up quietly are storage left behind after a server is stopped and data transfer you didn’t plan for.
✅ Checkpoint: You can say why zone IDs exist and which Regions are opt-in, and you can name the four kinds of charges.
Hands-on lab: AWS regions and availability zones, tags and cleanup
Sign in first and set the profile for this window, so you don’t need to type it on every command:
aws login --profile saat-root
$env:AWS_PROFILE = 'saat-root'
cd C:\aws-lab1See which Regions are on
Run this:
aws ec2 describe-regions --all-regions --query "Regions[?starts_with(RegionName,'ap-south')].[RegionName,OptInStatus]" --output textYou should see this (unless you’ve enabled Hyderabad):
ap-south-1 opt-in-not-required
ap-south-2 not-opted-inMumbai is on by default, while Hyderabad is an opt-in Region and stays off. Leave it off, since this course doesn’t need it.
2Compare zone names and zone IDs
Run this:
aws ec2 describe-availability-zones --query 'AvailabilityZones[].[ZoneName,ZoneId,State]' --output textYou should see something like this, though your name-to-ID pairs may be different:
ap-south-1a aps1-az1 available
ap-south-1b aps1-az3 available
ap-south-1c aps1-az2 available3Create two tagged resources that cost nothing
A security group and a standard Systems Manager parameter cost nothing, which makes them good for practising tags.
Paste this whole block:
$sg = aws ec2 create-security-group --group-name lab04-tag-test --description "Lesson 4 tag test" --tag-specifications 'ResourceType=security-group,Tags=[{Key=course,Value=saatvedha-aws},{Key=lesson,Value=04}]' --query GroupId --output text
$sg
aws ssm put-parameter --name /lab/04/note --type String --value "tag test" --tags Key=course,Value=saatvedha-aws Key=lesson,Value=04You should see something like this:
sg-0a1b2c3d4e5f67890
{
"Version": 1,
"Tier": "Standard"
}4Write the lab finder script
Run this to create C:\aws-lab\Find-LabResources.ps1:
@'
param([string]$Tag = 'saatvedha-aws')
$regions = aws ec2 describe-regions --query 'Regions[].RegionName' --output text
foreach ($r in ($regions -split '\s+')) {
$arns = aws resourcegroupstaggingapi get-resources --region $r --tag-filters "Key=course,Values=$Tag" --query 'ResourceTagMappingList[].ResourceARN' --output text
foreach ($a in ($arns -split '\s+')) {
if ($a -and $a -ne 'None') { [pscustomobject]@{ Region = $r; Resource = $a } }
}
}
'@ | Set-Content C:\aws-lab\Find-LabResources.ps1
.\Find-LabResources.ps1After about a minute you should see something like this:
Region Resource
------ --------
ap-south-1 arn:aws:ec2:ap-south-1:123456789012:security-group/sg-0a1b2c3d4e5f67890
ap-south-1 arn:aws:ssm:ap-south-1:123456789012:parameter/lab/04/noteThe script asks every Region that’s switched on, so it also catches resources that were created in the wrong Region by mistake. If PowerShell won’t run the script, run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once.

5Activate the cost allocation tags
In the console, open Billing and Cost Management and then Cost allocation tags. Find course and lesson under user-defined tags and choose Activate. New tag keys can take up to 24 hours to show up in this list, so if they aren’t there yet, come back tomorrow.
Open Cost Explorer once as well, because AWS only turns it on the first time you open it.
6Look at this month’s cost from the CLI
Run this. Each Cost Explorer API call costs USD 0.01, so don’t put it inside a loop:
$start = (Get-Date -Day 1).ToString('yyyy-MM-dd')
$end = (Get-Date).AddDays(1).ToString('yyyy-MM-dd')
aws ce get-cost-and-usage --region us-east-1 --time-period "Start=$start,End=$end" --granularity MONTHLY --metrics UnblendedCost --query 'ResultsByTime[0].Total.UnblendedCost'You should see something like this:
{
"Amount": "0",
"Unit": "USD"
}7Clean up
Run this:
aws ec2 delete-security-group --group-id $sg
aws ssm delete-parameter --name /lab/04/note
.\Find-LabResources.ps1For a few minutes the finder may still list the deleted items while the tagging index catches up, so keep running it until it prints nothing.
✅ Checkpoint: Find-LabResources.ps1 is in C:\aws-lab, it listed your two tagged resources, and after cleanup it prints nothing.
Break It, Then Fix It
Here are two location mistakes that waste real time at work.
1Break it: call a Region that is turned off
Run this:
aws ec2 describe-availability-zones --region ap-south-2You’ll get an error something like this:
An error occurred (AuthFailure) when calling the DescribeAvailabilityZones operation: AWS was not able to validate the provided access credentialsBecause the message talks about credentials, people go and reset passwords and keys, when the real cause is that the Region is opt-in and hasn’t been enabled for this account.
Fix: check OptInStatus (step 1 of the lab). Only enable the Region in Account settings if you really need it, and give it a few minutes to activate.
2Break it: a tag key with the wrong case
Create the security group again, and this time search with a capital C:
$sg = aws ec2 create-security-group --group-name lab04-tag-test --description "Lesson 4 tag test" --tag-specifications 'ResourceType=security-group,Tags=[{Key=course,Value=saatvedha-aws}]' --query GroupId --output text
aws resourcegroupstaggingapi get-resources --tag-filters Key=Course,Values=saatvedha-awsYou should see this:
{
"ResourceTagMappingList": []
}
Tag keys and values are case-sensitive, so Course and course are two different tags and turn up as two separate groups on the bill. Teams write their tag rules down and check them with AWS Config or tag policies for this reason.
Search with the correct key, then clean up:
aws resourcegroupstaggingapi get-resources --tag-filters Key=course,Values=saatvedha-aws --query 'length(ResourceTagMappingList)'
aws ec2 delete-security-group --group-id $sgThe first command should print 1 (or 2, if the deleted parameter is still sitting in the index for a few minutes).
✅ Checkpoint: You saw that a disabled Region looks like a credentials problem and that tag searches are case-sensitive, and nothing tagged for this course is still running.
This happened at work
The bill line nobody planned for
An e-commerce team had moved its app to AWS in Mumbai. For “high availability” they ran the app servers in ap-south-1a and the database in ap-south-1b. The app was a chatty one, with every page making dozens of small database calls, and on top of that a reporting job pulled whole tables every hour.
When the first full month’s bill came in, there was a line hardly anyone had looked at before: data transfer between zones. About 40 TB had gone back and forth between the two zones, charged in both directions at around USD 0.01 per GB each way, which worked out to roughly USD 800 a month, more than the database itself cost.
Dropping high availability wasn’t the answer. Instead they put app servers in both zones, kept each server talking to the database endpoint, moved the hourly report onto a read replica in the same zone as the reporting server, and cached the most common queries, which brought data transfer between zones down by about 80%. They also started checking the DataTransfer-Regional-Bytes usage type in Cost Explorer every month.
Common mistakes and troubleshooting
| Mistake | What happens | What to do |
|---|---|---|
| Assuming ap-south-1a is the same zone in every account | Two accounts “in the same zone” may not be, so latency and charges differ | Use zone IDs (aps1-az1) when accounts must line up |
| Everything in one zone | One zone problem takes the whole app down | Put anything important in at least two zones |
| Ignoring data transfer | A big, surprising line on the bill | Keep chatty parts in the same zone where you can, and check Cost Explorer by usage type |
| Stopping a server and thinking it costs nothing | EBS disks and snapshots still charge every month | Delete disks and snapshots you don’t need |
| Inconsistent tag keys (Course, course, COURSE) | Cost reports split into several groups | Write a tag standard and enforce it |
| Enabling every opt-in Region “just in case” | More places to watch and to forget resources | Enable only the Regions you use |
Interview questions
Click a question to open it. Each one is worded the way an interviewer might ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. How would you explain the difference between a Region and an Availability Zone to a new team member?
Why they ask this: They’re checking you know the basic AWS building blocks, since all of high availability rests on this idea.
How you might answer: I’d tell them a Region is a geographic area, like Mumbai, with its own set of services. Inside each Region there are at least three Availability Zones, which are separate groups of data centres with their own power and network that are still close enough for fast links. If I want my workload to stay up when one zone has trouble, I run it across several zones in the same Region.
2. Your company is launching an app for users in India. How would you pick the Region?
Why they ask this: They want to see you weigh real factors instead of grabbing the first Region on the list, thinking about users, rules and cost together.
How you might answer: I’d weigh latency to the users, data residency rules, whether the services I need are available in that Region, and price. With users in India, Mumbai or Hyderabad usually comes out ahead on latency.
3. In simple words, what are the main things AWS charges you for?
Why they ask this: They’re looking for basic billing awareness, because engineers who know where the money goes build cheaper systems.
How you might answer: Mostly compute time, storage per GB per month, requests and data transfer, especially data going out to the internet and between zones. Some services, like NAT gateways and load balancers, also charge by the hour just for existing, and in a lab those are easy to forget about.
2–5 years experience
4. Two accounts both put a server in ap-south-1a, but the latency between them is higher than expected. What might be going on?
Why they ask this: They want to know if you understand that each account maps zone names differently, a detail that only comes up in real multi-account work.
How you might answer: AWS maps zone names like ap-south-1a to physical zones differently for each account, so the two servers could well be in different physical zones. The zone ID, like aps1-az1, is what tells you the real physical zone. When accounts share subnets or need the same zone for latency or data transfer cost, I compare zone IDs rather than names.
5. A command works fine in Mumbai but returns AuthFailure in another Region. What do you suspect before touching credentials?
Why they ask this: They want to see if you know about opt-in Regions, and they like candidates who rule out the simple causes before resetting keys.
How you might answer: I’d suspect an opt-in Region that hasn’t been enabled for the account, so I’d run aws ec2 describe-regions --all-regions and check OptInStatus. I’d only start looking at credentials once I knew the Region was enabled.
6. Your manager asks which project is driving the AWS bill. How would you find out?
Why they ask this: They want to see you know tagging and the cost tools, because answering money questions quickly is how you earn a manager’s trust.
How you might answer: I’d lean on a tag standard, say app, owner and env, applied to every resource and activated as cost allocation tags, and then group by those tags and by service in Cost Explorer. Untagged spend gets a report of its own so somebody owns fixing it.
Senior level
7. You’re asked to design a tagging strategy for a company with 30 teams. How would you make sure it actually sticks?
Why they ask this: They’re looking for governance that lasts, not a wiki page nobody reads, and enforcement and reporting count as much as the tag list.
How you might answer: I’d keep the list of required keys short, like app, owner, env and cost-centre, each with allowed values. They’d be enforced at creation through tag policies in AWS Organizations and defaults in our infrastructure code, and checked with AWS Config rules. I’d activate them as cost allocation tags so finance can see spend by team, and send a weekly report of untagged resources to an owner.
8. Finance tells you the data transfer bill doubled this month. Walk me through how you’d investigate.
Why they ask this: They want a methodical approach to cost problems, and they want to hear that you’d fix the pattern instead of only explaining the number.
How you might answer: I’d filter Cost Explorer down to data transfer and group it by usage type, like internet out, inter-AZ, inter-Region and NAT gateway, and then by resource where I can. VPC Flow Logs would show me which instances are talking across zones or out to the internet. After that I’d fix the pattern, which might mean caching, keeping traffic inside one zone, using VPC endpoints for S3 instead of the NAT gateway, or putting CloudFront in front of public downloads.
Quick quiz
Q1. How many Availability Zones does every AWS Region have at least?
- One
- Two
- Three
- Six
Show answer
C: every Region has at least three Availability Zones.
Q2. Why would you compare zone IDs instead of zone names between two accounts?
- Zone IDs are shorter
- Names like ap-south-1a can point to different physical zones in each account
- Zone names change every day
- Zone IDs are cheaper
Show answer
B: AWS maps zone names separately for each account, while zone IDs are the same everywhere.
Q3. A command fails with AuthFailure only in ap-south-2. What is the likely cause?
- Wrong password
- The opt-in Region is not enabled
- The CLI is too old
- You have no budget
Show answer
B: Hyderabad is an opt-in Region, and calls to a Region that isn’t enabled fail with AuthFailure.
Q4. Which of these is charged in both directions?
- Data from the internet into AWS
- Data between two Availability Zones
- Data inside one zone using private IPs
- None of these
Show answer
B: data transfer between Availability Zones is charged on both sides.
Q5. Your tag search for Key=Course returns nothing, but resources have course=saatvedha-aws. Why?
- Tags take a week to work
- Tag keys are case-sensitive
- Security groups can’t be tagged
- The tagging API only works in us-east-1
Show answer
B: Course and course count as two different keys.
Quick recap
- A Region is a separate area (Mumbai is ap-south-1), and each one has at least three Availability Zones with their own power and networks.
- Zone names are per account, but zone IDs (aps1-az1) are the same for everyone. Opt-in Regions stay off until you enable them.
- You pay for compute, storage, requests and data transfer, and data between zones is charged both ways.
- Tags are case-sensitive, and you need to activate cost allocation tags before you can see cost by tag.
- Find-LabResources.ps1 lists every resource tagged course=saatvedha-aws in every enabled Region, so run it after each lab.
Next lesson
Lesson 5: IAM basics: users, groups, roles and policies → Next you stop using root on the CLI and build your first users, groups and roles.
Further reading: AWS regions and availability zones
If you want to go further with AWS regions and availability zones, read AWS Regions and Availability Zone IDs for your AWS resources in the AWS documentation. The full plan for this course is on the AWS Cloud Administration course page.
