0
0
AWScloud~5 mins

AWS global infrastructure (regions, AZs) - Commands & Configuration

Choose your learning style9 modes available
Introduction
AWS global infrastructure is a network of data centers around the world. It helps run applications close to users for better speed and reliability. Regions and Availability Zones (AZs) organize these data centers to keep services running even if one part fails.
When you want your app to be fast for users in different countries by running it near them.
When you need your app to keep working even if one data center has a problem.
When you want to back up data in a different location to avoid losing it.
When you plan to expand your service to new markets and need local servers.
When you want to balance traffic across multiple data centers for better performance.
Commands
This command lists all AWS regions available to your account in a readable table format. It helps you see where you can deploy resources.
Terminal
aws ec2 describe-regions --output table
Expected OutputExpected
------------------------- | DescribeRegions | +-------------------------+ | RegionName | Endpoint | |--------------|----------| | us-east-1 | ec2.us-east-1.amazonaws.com | | us-west-2 | ec2.us-west-2.amazonaws.com | | eu-west-1 | ec2.eu-west-1.amazonaws.com | +-------------------------+
--output - Formats the output for easier reading
This command shows the Availability Zones in the us-east-1 region. AZs are separate data centers that help keep your app running if one fails.
Terminal
aws ec2 describe-availability-zones --region us-east-1 --output table
Expected OutputExpected
--------------------------------- | DescribeAvailabilityZones | +-------------------------------+ | ZoneName | State | RegionName | |------------|---------|------------| | us-east-1a | available | us-east-1 | | us-east-1b | available | us-east-1 | | us-east-1c | available | us-east-1 | +-------------------------------+
--region - Specifies the AWS region to query
--output - Formats the output for easier reading
Key Concept

If you remember nothing else from this pattern, remember: AWS regions are separate geographic areas, and Availability Zones are isolated data centers within those regions that keep your apps reliable.

Common Mistakes
Trying to deploy resources without specifying the region.
AWS defaults to a region, which might not be where you want your resources, causing latency or compliance issues.
Always specify the region explicitly in commands or configuration to control where your resources run.
Assuming all Availability Zones are the same across accounts.
AZ names like us-east-1a can map to different physical locations per account, so hardcoding AZ names can cause issues.
Query AZs dynamically per account or use AZ IDs to avoid confusion.
Summary
Use 'aws ec2 describe-regions' to see all AWS regions where you can deploy resources.
Use 'aws ec2 describe-availability-zones' with a region to list its data centers for high availability.
Always specify regions and understand AZs to build fast and reliable applications.