In this chapter, we will be using Terraform to deploy a distributed edge application on EKS that has a presence in three locations: an AWS Wavelength Zone, an AWS Local Zone, and the associated AWS Parent Region. The Wavelength and Local Zones are both in the same major metropolitan area. Depending upon the city you select, the Parent Region may be hundreds of miles away.
You will be able to see how a distributed EKS cluster that spans these edge locations can be put together, and clearly see the impact your entry point has on latency.
Check out the following video to view the Code in Action: https://bit.ly/47LxSqd
We’ll cover the following topics:
Deploying a distributed EKS cluster with Terraform
Using Terraform to push a distributed application
Testing the application from multiple sources
Cleanup
Notes
Deploying a distributed EKS cluster with Terraform
In the last chapter, we used Infrastructure As Code (IaC) written in AWS CloudFormation. In this chapter, we will use a different tool – HashiCorp Terraform. It is similar to AWS CloudFormation in that you create template files that describe interrelated infrastructure components you want created in your AWS account.
However, Terraform supports more than just AWS via a lengthy list of providers. This makes it popular with those who need to manage resources in multiple clouds – as well as on-premise elements such as VMware virtual machines or even bare-metal servers. AWS is a strong supporter of Terraform, with over 2 billion downloads of the AWS Terraform provider since 2014.
The IaC provided supports the following 15 US cities: Atlanta, Boston, Chicago, Dallas, Denver, Houston, Las Vegas, Los Angeles, Miami, Minneapolis, New York City, Phoenix, San Francisco, Seattle, and Washington DC.
It also supports the following four non-US cities: London, Osaka, Seoul, and Tokyo.
Note about AWS Local Zone availability
Some major cities that have AWS Wavelength Zones do not also have AWS Local Zones because there is already a full AWS Region there. For these areas, instead of a Local Zone, one of the normal Availability Zones in that region will be used.
The cities affected by this are London, Osaka, San Francisco, Seoul, Tokyo, and Washington DC.
Architecture
The next figure gives a high-level overview of what the Terraform IaC in this exercise will deploy when the selected edge city is Atlanta:

Figure 13.1 – Distributed edge application overview when edge_city = atlanta
The purposes of this design and associated Terraform IaC are as follows:
Showing you the difference in user experience for three different ways of accessing the same application
Familiarizing you with using Terraform to deploy EKS in a distributed fashion
Giving you an example of how to manage a Kubernetes deployment for a sample distributed application