Mani
5 min readOct 11, 2022

--

India Gate — New Delhi — Photo by Vishnu Pavan on Unsplash

A Local Zone is an extension of an AWS Region in geographic proximity to your users. Local Zones have their own connections to the internet and support AWS Direct Connect, so resources created in a Local Zone can serve local users with low-latency communications

Update: On Dec 19, 2022, AWS announced the the general availability of AWS Local Zones in Bangkok and Kolkata !! This blog was written at the launch of the AWS Local Zone in Delhi (India), and the same instructions should apply in the new Local Zone in Kolkata also. I will update this blog, when more AWS services and updates happen in the India Local Zones. Please see the launch announcement at https://aws.amazon.com/about-aws/whats-new/2022/12/general-availability-aws-local-zones-bangkok-kolkata/ for more details ..

AWS Local Zones — Mumbai and Kolkata

We had an announcement last week, about the launch of Local Zones in Taipei (Taiwan) and Delhi (India) !! We have also announced plans for additional Local Zones in India at Bengaluru [my hometown and my favorite ;-)], Chennai and Kolkata. Please do submit your interest in these upcoming Local Zones at https://aws.amazon.com/about-aws/global-infrastructure/localzones/locations/

Disclaimer: Please refer to official AWS documentation and blogs, this is a personal blog meant to document my own learnings.

The webpage at https://aws.amazon.com/about-aws/global-infrastructure/localzones/ has very detailed information including links to blogs, FAQs and others.

Also, the pricing for Local Zones varies, please check https://aws.amazon.com/about-aws/global-infrastructure/localzones/pricing/ for more details.

Ok, as with all new shiny things, I wanted to give the Delhi Local Zone a quick spin. The list of AWS services available in the Local Zones is available at https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/

As you can see, we have EC2, EBS, VPC and more importantly AWS Container services like Amazon ECS and EKS, available as of today at the Delhi Local Zone. Obviously, this will change over time, as more services will become available.

AWS services available in Local Zones

So, this write up is about spinning an Amazon ECS Cluster and run an Amazon ECS service/task in the Delhi Local Zone.

The steps will be to create an VPC, an public subnet in the Delhi Local Zone and then create an ECS cluster with a simple nginx service running in the EC2 instance running in the Delhi Local Zone. Since, ALB is not yet available in the Delhi Local Zone, we will access the ECS task via a public IP address. Please note, you can also launch standard EC2 instances with EBS volumes in the Local Zone also, its just I am a container first guy ;-)

There is also an awesome blog on running Amazon EKS cluster in a local zone at https://aws.amazon.com/blogs/containers/running-workload-on-amazon-eks-in-local-zones-with-resilient-architecture/, but this will require an ALB for Ingress, which is not yet available in Delhi Local Zone.

The ECS control plane will run in the parent zone, in this case the AWS Mumbai region.

Deployment diagram — Running an ECS service in the Local Zone — Delhi

Step 1: To use a Local Zone, you must opt-in to the zone.

Enabled the Delhi Local Zone ..

You can get a list of supported EC2 Instance types in the Delhi local zone by this command (I ran this command using the AWS CloudShell):

aws ec2 describe-instance-type-offerings --location-type availability-zone  --filters Name=location,Values=ap-south-1-del-1a --region ap-south-1 --output table
available EC2 instance types in the Delhi local zone ..

Step 2: Create a VPC subnet in the Delhi Local Zone

I created a new VPC in the Mumbai region and created a public subnet in the Delhi Local zone.

Step 3: Create an ECS cluster and deploy an ECS Task in the Delhi Local Zone

I created an Amazon ECS cluster with one EC2 Linux instance, make sure you specify the EC2 instance that is available in the Delhi Local Zone (see the previous command to get the list of Instance types)

Note, my ECS cluster has just one EC2 instance, which is not a good practice from a availability and deployment perspective ..

ECS cluster with a single EC2 instance running in the Delhi Local Zone

I have a task definition for a simple nginx container image, which I will then launch in this ECS cluster on this EC2 instance running in Delhi local zone as an ECS service

ECS Task definition, with nginx contaioner image

Instead of running a single ECS task, we will create an ECS service, with one task, which will ensure that Task remains running.

From the ECS documentation:

You can use an Amazon ECS service to run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster. If one of your tasks fails or stops, the Amazon ECS service scheduler launches another instance of your task definition to replace it. This helps maintain your desired number of tasks in the service.

The best practice, when you have more than one Task is to use an ALB, which will be the single end point for end users or other applications.

ECS service
A single Task running the nginx container as part of the ECS service

That’s it !! Now, lets access the nginx app via the public IP.

nginx app, access from an ECS task running in an EC2 instance running in the Delhi Local Zone

In summary reiterating the messaging from the AWS blog, “Applications hosted in a Local Zone benefit from very low (single-digit millisecond) latency access to EC2 instances and other AWS services. Local Zones also give AWS customers additional choices regarding data residency, giving them the ability to store and process sensitive data (often financial or personal in nature) in-country.”

Hope this short and quick blog was useful.

--

--

Mani

Principal Solutions Architect at AWS India, and I blog/post about interesting stuff that I am curious about and which is relevant to developers & customers.