Sub topic 10
Local Zones, Wavelength Zones, and edge locations
This chapter assumes you know what a Region and an Availability Zone (AZ) are, and that you can run AWS CLI commands. It covers the three kinds of infrastructure that sit outside the standard Region and AZ model. They serve different purposes, and mixing them up is a common source of confusion.
Why extend beyond Regions
A Region is often far from some of your users or equipment. If a game server, a video editing studio, or a factory needs single-digit millisecond latency, distance to the nearest Region can be too large. AWS addresses this with infrastructure placed closer to users. Each kind works differently, so choose by what you need to run.
The three kinds of location
- Local Zone: an extension of a Region placed near a large city or industry center. You run selected services such as EC2, EBS, and VPC subnets there. A Local Zone belongs to a parent Region.
- Wavelength Zone: AWS infrastructure embedded inside a telecom provider's 5G network. Mobile devices reach your application without leaving the carrier network. A Wavelength Zone also belongs to a parent Region.
- Edge location: a site used by services such as Amazon CloudFront and Route 53. Edge locations cache content and answer requests. You do not launch EC2 instances in them.
How zones appear in your account
Local Zones and Wavelength Zones are not enabled by default. You opt in to each one per account, much like an opt-in Region. Once enabled, they show up in the same API that lists AZs, and the ZoneType field tells them apart.
aws ec2 describe-availability-zones --region us-east-1 \
--all-availability-zones \
--query "AvailabilityZones[?ZoneType!='availability-zone'].[ZoneName,ZoneType,OptInStatus,ParentZoneName]" \
--output table--all-availability-zones includes zones you have not enabled. The OptInStatus column shows not-opted-in for those. The ParentZoneName column links the zone to the AZ in its parent Region.
To enable a zone group, use its group name from the GroupName field:
aws ec2 modify-availability-zone-group \
--group-name us-east-1-bos-1 \
--opt-in-status opted-in \
--region us-east-1The group name us-east-1-bos-1 is an example. Look up the real names in your own output before running this.
Working with an extended zone
Once enabled, you place resources there the same way you do in an AZ. You create a subnet in the zone, then launch instances into that subnet.
aws ec2 create-subnet \
--vpc-id vpc-0123456789abcdef0 \
--cidr-block 10.0.8.0/24 \
--availability-zone us-east-1-bos-1aThe VPC ID is a placeholder. The VPC itself stays in the parent Region. Only the subnet lives in the extended zone.
Common errors and limits
- Not every service is available. Local Zones and Wavelength Zones support a subset of services. Check which instance types and storage types a zone offers before you design around it.
- Opt-in is required. Launching into a zone you have not enabled fails with an error about the zone being unavailable.
- Resilience is lower. A single Local Zone is not a replacement for multiple AZs. If you need availability, keep a presence in the parent Region's AZs too.
- Prices differ. Instances and data transfer in extended zones are often priced higher than in the parent Region. Check pricing for the specific zone.
- Edge locations are not a placement target. You cannot choose an edge location for your servers. You only benefit from them by using CloudFront, Route 53, or similar services.
Choosing between them
| Need | Best fit |
|---|---|
| Cache static or streaming content worldwide | Edge location through CloudFront |
| Run compute near a large city for low latency | Local Zone |
| Serve 5G mobile devices with ultra-low latency | Wavelength Zone |
| Highest availability for a normal workload | Multiple AZs in a Region |
Exercise
A team runs a web API in one Region and wants faster image downloads for users around the world. They also want their API servers to keep their current multi-AZ layout. Which of the three location types should they use, and do they need to opt in to anything?
Show answer
They should use CloudFront, which delivers images from edge locations. They do not launch servers in edge locations, and no opt-in is needed. A Local Zone or Wavelength Zone is unnecessary because the goal is content delivery, not running compute closer to users. The API servers stay in the Region's AZs.
Exercise
You run the describe-availability-zones command with --all-availability-zones and see a zone with ZoneType local-zone and OptInStatus not-opted-in. What must you do before you can create a subnet in it?
Show answer
Opt in to the zone's group, for example with aws ec2 modify-availability-zone-group using the GroupName value and --opt-in-status opted-in. After that you can create a subnet in the zone.