Bird
Raised Fist0
AWScloud~10 mins

AWS global infrastructure (regions, AZs) - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the AWS region for deployment.

AWS
provider "aws" {
  region = "[1]"
}
Drag options to blanks, or click blank then click option'
Aus-east-1
Beurope-west1
Casia-south1
Dus-central
Attempts:
3 left
💡 Hint
Common Mistakes
Using region codes from other cloud providers.
Using incomplete or incorrect region codes.
2fill in blank
medium

Complete the code to select an Availability Zone in the us-east-1 region.

AWS
resource "aws_instance" "example" {
  availability_zone = "us-east-1[1]"
  ami               = "ami-0c94855ba95c71c99"
  instance_type     = "t2.micro"
}
Drag options to blanks, or click blank then click option'
Aa
Bz1
Cb
Dc
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid AZ suffixes like 'z1'.
Confusing AZ names with region codes.
3fill in blank
hard

Fix the error in the code to correctly reference an Availability Zone in the eu-west-1 region.

AWS
resource "aws_subnet" "example" {
  vpc_id            = "vpc-123456"
  cidr_block        = "10.0.1.0/24"
  availability_zone = "eu-west-1[1]"
}
Drag options to blanks, or click blank then click option'
Aa
Bzone1
C1a
Dwest-1a
Attempts:
3 left
💡 Hint
Common Mistakes
Adding numbers or extra words in AZ suffix.
Using incorrect region codes.
4fill in blank
hard

Fill both blanks to create a subnet in the us-west-2 region and specify its Availability Zone.

AWS
resource "aws_subnet" "example" {
  vpc_id            = "vpc-789012"
  cidr_block        = "10.0.2.0/24"
  availability_zone = "[1][2]"
}
Drag options to blanks, or click blank then click option'
Aus-west-2
Bus-east-1
Ca
Db
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing region codes and AZ suffixes incorrectly.
Using invalid region or AZ values.
5fill in blank
hard

Fill all three blanks to define an EC2 instance in the ap-southeast-1 region, in Availability Zone 'b', with instance type 't3.micro'.

AWS
resource "aws_instance" "example" {
  ami               = "ami-0abcdef1234567890"
  instance_type     = "[1]"
  availability_zone = "[2][3]"
}
Drag options to blanks, or click blank then click option'
At3.micro
Bap-southeast-1
Cb
Dus-east-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong instance types.
Mixing up region and AZ suffix order.
Using invalid AZ suffixes.

Practice

(1/5)
1. What is an AWS Region?
easy
A. A large geographic area containing multiple isolated data centers
B. A single data center inside AWS infrastructure
C. A network of connected servers in one building
D. A type of AWS service for storage

Solution

  1. Step 1: Understand AWS Region concept

    AWS Regions are big geographic areas that contain multiple data centers.
  2. Step 2: Differentiate from other options

    Options A and B describe smaller units like networks or data centers, not regions. A type of AWS service for storage is unrelated to infrastructure.
  3. Final Answer:

    A large geographic area containing multiple isolated data centers -> Option A
  4. Quick Check:

    Region = big area with many data centers [OK]
Hint: Regions are big areas, not single data centers [OK]
Common Mistakes:
  • Confusing a region with a single data center
  • Thinking regions are just networks or services
  • Mixing up regions with availability zones
2. Which of the following correctly describes an Availability Zone (AZ) in AWS?
easy
A. A single isolated data center within a region
B. A group of regions connected by high-speed links
C. A virtual server instance in AWS
D. A storage bucket for backups

Solution

  1. Step 1: Define Availability Zone

    An AZ is an isolated data center inside a region designed for fault tolerance.
  2. Step 2: Eliminate incorrect options

    A group of regions connected by high-speed links describes regions, not AZs. A virtual server instance in AWS is about compute instances, and D is storage-related.
  3. Final Answer:

    A single isolated data center within a region -> Option A
  4. Quick Check:

    AZ = isolated data center inside region [OK]
Hint: AZs are isolated data centers, not servers or storage [OK]
Common Mistakes:
  • Confusing AZ with a server or instance
  • Thinking AZs are groups of regions
  • Mixing AZs with storage services
3. You deploy an application in AWS using two Availability Zones in the same region. What is the main benefit of this setup?
medium
A. It reduces latency by serving users from multiple continents
B. It stores backups in different AWS services
C. It increases fault tolerance by isolating failures to one AZ
D. It automatically scales the application to more regions

Solution

  1. Step 1: Understand multi-AZ deployment

    Deploying in multiple AZs protects the app from failure in one AZ by isolating faults.
  2. Step 2: Analyze options

    It reduces latency by serving users from multiple continents is about continents, not AZs. It automatically scales the application to more regions talks about regions, which is different. It stores backups in different AWS services is unrelated to AZ deployment.
  3. Final Answer:

    It increases fault tolerance by isolating failures to one AZ -> Option C
  4. Quick Check:

    Multi-AZ = better fault tolerance [OK]
Hint: Multiple AZs protect from single data center failure [OK]
Common Mistakes:
  • Thinking multi-AZ means multi-region
  • Assuming it automatically scales globally
  • Confusing AZs with backup storage
4. A developer tries to deploy an application across two AWS regions but uses the same Availability Zone name in both regions. What is the likely issue?
medium
A. Availability Zone names are globally unique, so this will cause a deployment error
B. Availability Zone names are unique only within a region, so using the same name in different regions is valid
C. Regions cannot have Availability Zones with the same name, so deployment will fail
D. Using the same AZ name in different regions will cause data loss

Solution

  1. Step 1: Understand AZ naming scope

    AZ names are unique only inside their region; different regions can have AZs with the same name.
  2. Step 2: Evaluate deployment impact

    Using the same AZ name in different regions is allowed and does not cause errors or data loss.
  3. Final Answer:

    Availability Zone names are unique only within a region, so using the same name in different regions is valid -> Option B
  4. Quick Check:

    AZ names unique per region, not global [OK]
Hint: AZ names repeat across regions, unique only inside region [OK]
Common Mistakes:
  • Assuming AZ names are globally unique
  • Believing same AZ name causes deployment failure
  • Confusing AZ naming with region naming
5. You want to design a highly available web application on AWS that serves users worldwide with low latency. Which combination of AWS global infrastructure components should you use?
hard
A. Deploy the app in multiple regions but only one Availability Zone per region
B. Deploy the app in multiple Availability Zones within a single region only
C. Deploy the app in a single Availability Zone in one region and use AWS CloudFront
D. Deploy the app in multiple regions and use multiple Availability Zones in each region

Solution

  1. Step 1: Identify requirements for high availability and low latency

    High availability needs multiple AZs to avoid single points of failure. Low latency worldwide needs multiple regions closer to users.
  2. Step 2: Analyze options for meeting requirements

    Deploy the app in multiple regions and use multiple Availability Zones in each region uses multiple regions and AZs, covering both availability and latency. Deploy the app in multiple Availability Zones within a single region only lacks multi-region coverage. Deploy the app in a single Availability Zone in one region and use AWS CloudFront has single AZ, risking failure. Deploy the app in multiple regions but only one Availability Zone per region lacks multi-AZ redundancy.
  3. Final Answer:

    Deploy the app in multiple regions and use multiple Availability Zones in each region -> Option D
  4. Quick Check:

    Multi-region + multi-AZ = best availability & latency [OK]
Hint: Use multiple regions and AZs for best availability and speed [OK]
Common Mistakes:
  • Using only one region limits global reach
  • Using single AZ risks downtime
  • Relying on CloudFront alone doesn't ensure availability