LinuxUnity LinuxUnity

Posts

Getting Started with AWS: Regions, Availability Zones, Edge Locations, and IAM

Learn the fundamentals of Amazon Web Services (AWS), including cloud computing models, AWS global infrastructure, access methods, and Identity and Access Management (IAM).

02/04/2026 11 min read 11 views

Z Zedx

AWS
In this article

What is AWS?

Amazon Web Services (AWS) the world's largest cloud computing platform, providing more than 200 services from data centers around the globe. Launched in 2006, AWS currently holds approximately 32% of the cloud market (2024), far ahead of Microsoft Azure (~22%) and Google Cloud (~11%).

Cloud Computing Model

AWS operates according to the pay-as-you-go model, so you only pay for what you use and do not need to make an upfront infrastructure investment. There are 3 main service models:

Model Abbreviation Managed by You Managed by AWS Example
Infrastructure as a Service IaaS OS, Runtime, App, Data Hardware, Network EC2
Platform as a Service PaaS App, Data Hardware, OS, Runtime Elastic Beanstalk, RDS
Software as a Service SaaS Proactive All Gmail, Salesforce

Shared Responsibility Model

Security OF the Cloud (AWS) Security IN the Cloud (Customer)
Physical data centers Data encryption (at rest & in transit)
Hardware, networking IAM users, roles, policies
Managed services (RDS, DynamoDB???) Security Groups, NACLs
Hypervisor, host OS OS patching (with EC2)
Application-level security

AWS global infrastructure

This is one of the most frequently tested topics in the foundational section. You must memorize all three concepts and the differences between them.

Region

Region is an independent physical geographic area where AWS deploys clusters of data centers. Each Region is completely independent of the others Data in one Region does not affect another Region.

aws region

How to choose a Region: Based on four factors:

  • Compliance/Legal: Is the data legally permitted to leave the country?
  • Latency: The Region closest to the users
  • Service availability: Not every service is available in every Region
  • Pricing: Prices vary between Regions

Important note: Most AWS services are Region-scoped — S3 bucket — us-east-1 completely separate from a bucket with the same name — ap-southeast-1Some services are Global (IAM, Route 53, CloudFront, WAF) and are not tied to a specific Region.

Availability Zone (AZ)

aws azs

Each Region (for example: ap-southeast-2) consists of at least 2, typically 3–6 AZs. Each AZ consists of one or more physically separate data centers with:

  • Independent power sources
  • Dedicated network connectivity
  • Dedicated cooling systems

AZs within the same Region are connected by low-latency private network (< 1ms). This is the foundation of High Availability Deploy your app across multiple AZs to withstand the failure of a single AZ.

Edge Location & Points of Presence

Edge Locations (also known as Points of Presence) are AWS content distribution points, far more numerous than Regions (700+ PoPs in 90+ cities). Used by:

  • CloudFront (CDN): Cache content as close to users as possible to reduce latency
  • Route 53 (DNS): Fast DNS resolution
  • AWS Shield: DDoS protection
  • Lambda@Edge: Run Lambda code close to users
text
Không có AWS Region ở Hà Nội hay TP.HCM, nhưng có Edge Location
→ CloudFront cache content ở đây → users Việt Nam trải nghiệm tốt hơn

Infrastructure overview

aws infa

  • AWS Global Infrastructure: AWS's global infrastructure, distributed across multiple regions
  • Regions (~39 regions): Geographically isolated areas; each region contains a different set of AWS services
  • Availability Zones (~123 AZs) (2–6 per region): Separate data centers within the same region that improve availability and fault tolerance
  • Data Centers: The physical infrastructure (servers, network, and storage) located within each AZ
  • Edge Locations (700+): Used for caching (CDN) and DNS; not used to run services such as EC2 or RDS

How to Access AWS

There are three ways to interact with AWS. All three ultimately call the same underlying AWS API; they differ only in their interfaces.

  • AWS Management Console — a web interface, protected by a password + MFA
  • AWS CLI (Command Line Interface) — a command-line interface, protected by access keys
  • AWS SDK (Software Developer Kit) — integrated into code, protected by access keys

Access Keys are created through the AWS Console and must be protected like a password—do not share them with anyone.

  • Access Key ID equivalent to a username
  • Secret Access Key equivalent to a password

AWS CLI (Command Line Interface)

A command-line tool that enables interaction with AWS services through a command-line shell, with direct access to AWS public APIs. Open source at github.com/aws/aws-cli.

text

text
# Tạo profile riêng
aws configure --profile dev-account
aws configure --profile prod-account

# Dùng profile cụ thể
aws s3 ls --profile dev-account
aws ec2 describe-instances --profile prod-account

# Hoặc set environment variable
export AWS_PROFILE=dev-account

AWS SDK (Software Development Kit)

A set of API libraries for each programming language, allowing you to access and manage AWS services directly from within your application.

IoT Device SDKs: Embedded C, Arduino

SDKs: JS, Python, PHP, .NET, Ruby, Java, Go, Node.js, C++

Mobile SDKs: Android, iOS

Examples:

text
#
text
# Python SDK: boto3
# Cài đặt
# pip install boto3

import boto3

# Tạo S3 client
# SDK tự động lấy credentials từ:
# 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
# 2. ~/.aws/credentials file
# 3. IAM Role (khi chạy trên EC2/Lambda/ECS)
s3 = boto3.client('s3', region_name='ap-southeast-1')

# List buckets
response = s3.list_buckets()
for bucket in response['Buckets']:
    print(f"  {bucket['Name']}")

# Tạo bucket
s3.create_bucket(
    Bucket='my-bucket',
    CreateBucketConfiguration={'LocationConstraint': 'ap-southeast-1'}
)

AWS CloudShell

CloudShell is a browser-based terminal directly in the AWS Console—no need to install the AWS CLI, with credentials automatically inherited from your console session. It includes 1 GB of persistent storage. Very convenient for quick testing.

AWS IAM — Identity and Access Management

Users & Groups

IAM is a service for managing identities and access permissions, operating at the Global scope (not tied to a region).

Root account is created by default when you sign up for AWS. It should not be used for everyday work and must never be shared with anyone.

Users represent individual people in an organization. Users can be grouped into Groups for centralized permission management. Important notes:

  • Users are not required to belong to any group.
  • A user can belong to multiple groups simultaneously.
  • Groups contain only users, not other groups.

Permissions

Permissions are defined through JSON policies — attached directly to a user or group.

AWS follows the Least Privilegeprinciple: grant only the permissions required, and no more.

The structure of a JSON policy includes:

  • Version — the policy language version
  • Id — the policy identifier (optional)
  • Statement One or more permission statements (required)

Each Statement includes:

  • Sid An identifier for the statement (optional)
  • Effect — Allow or Deny
  • Principal The account/user/role to which it applies
  • Action The list of allowed or denied actions
  • Resource The resource to which the action applies
  • Condition The conditions under which the policy is effective (optional)

Policies The Document JSON defines permissions:

text

text
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowS3ReadOnly",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::my-bucket",
                "arn:aws:s3:::my-bucket/*"
            ]
        }
    ]
}

IAM Policy Inheritance (Permission Inheritance)

Permissions are inherited according to an additive mechanism: if a user belongs to multiple groups, that user receives the combined permissions from all of those groups. Policies can also be attached directly to the user (inline policies), in addition to permissions inherited from groups.

Password Policy & MFA

To protect AWS accounts, two primary security layers are combined.

Password Policy allows you to define mandatory password rules for all IAM users: minimum length, special-character requirements, expiration periods, and prevention of password reuse. The more complex the password, the lower the risk of brute-force attacks.

MFA (Multi-Factor Authentication) is a second layer of protection based on a password. The principle is: MFA = something you know (a password) + something you have (a device). Even if the password is exposed, an attacker still cannot sign in without the MFA device. AWS supports virtual MFA applications such as Google Authenticator and Authy, as well as physical hardware keys such as YubiKey.

These two layers complement each other: Password Policy reduces the risk of weak passwords being guessed, while MFA ensures that even if a password is compromised, the account remains secure. MFA should be enabled for all accounts, especially the Root account.

You can refer to the following resources for more information:

IAM Roles for Services

Some AWS services (such as EC2 and Lambda) need to access other services (S3, CloudWatch...), and every request must include valid credentials.

Embedding Access Keys directly in code is insecure and difficult to manage.

Therefore, AWS uses IAM Roles: you define the required permissions in a role, then attach that role to the service that needs to use them.

When the service runs, AWS automatically provides temporary credentials (with an expiration time) through STS and automatically rotates them, so no manual intervention is required.

This makes the system more secure while eliminating the need to manage static keys.

How it works:

An IAM Role with permission to access S3 is attached to an EC2 instance. When it runs, EC2 “assumes” this role to obtain temporary credentials.

The role contains a policy that allows s3:GetObject, so EC2 can call the S3 API to retrieve data.

👉 Result: EC2 can access S3 without using an Access Key in the code, which improves security and reduces the risk of key leakage.

Common roles

  • EC2 Instance Roles — grant EC2 permission to access services such as S3, DynamoDB, and CloudWatch; this is the most common use case.
  • Lambda Execution Roles — each Lambda function needs a role to read/write data, write logs, and call other services; without a role, it can only run standalone logic.
  • CloudFormation Roles — allow CloudFormation to create and manage resources (EC2, S3, RDS, etc.) on your behalf when deploying infrastructure.

IAM Security Tools

Two tools that help audit and review access permissions in an account.

  • IAM Credentials Report (account-level) — a report listing all users in the account along with the status of their credentials: passwords, Access Keys, and MFA. Use it to identify unused accounts or accounts without MFA enabled.
  • IAM Access Advisor (user-level) — displays the service permissions granted to a specific user and the last time that user accessed each service. Use it to reduce permissions according to the principle of least privilege—if a service has never been used, its permissions can be removed.

IAM Guidelines & Best Practices

  • Do not use the Root account except for the initial AWS setup
  • One actual user = one separate IAM user
  • Add users to groups, attach permissions to groups — do not attach them directly to each user
  • Create a strong password policy
  • Enable MFA by default
  • Create and use Roles to grant permissions to AWS services
  • Use Access Keys for CLI / SDK access
  • Regularly audit permissions using IAM Credentials Report and IAM Access Advisor
  • Never share IAM users or Access Keys

Shared Responsibility Model

Security on AWS is a shared responsibility between AWS and the customer.

AWS Customer
Global security infrastructure Manage and monitor Users, Groups, Roles, and Policies
Analyze configurations and vulnerabilities Enable MFA on all accounts
Check compliance Rotate Access Keys periodically
Use IAM tools to apply least-privilege permissions
Analyze access patterns and review permissions

IAM Section Summary

Component Role
Users Mapped to real users, with a password for Console access
Groups Contain users and are used to assign permissions centrally
Policies JSON document defining permissions for users or groups
Roles Grant permissions to EC2 instances and AWS services
Security MFA + Password Policy
AWS CLI Manage AWS services via the command line
AWS SDK Manage AWS services via a programming language
Access Keys Authenticate when using the CLI or SDK
Audit IAM Credentials Report & IAM Access Advisor

Find more useful articles about AWS