To remove all of the components deployed by the Terraform IaC, perform the following steps. Note that removal happens in reverse order of deployment.
Step 1 – Using terraform destroy to remove kubernetes-config elements
Since you should still be in the kubernetes-config directory, you can proceed immediately to the terraform destroy command shown here:
terraform destroy -var=edge_city=atlanta -auto-approve
When the process is complete, you should see an output similar to that shown in the following figure:

Figure 13.20 – Using terraform destroy to remove kubernetes-config elements
Step 2 – Using terraform destroy to remove eks-cluster elements
First, you will need to change directory to eks-cluster using the following command:
cd ../eks-cluster
Once you’re there, you can issue the exact same terraform destroy command you did in step 1:
terraform destroy -var=edge_city=atlanta -auto-approve
Upon successful completion, you should see an output similar to that shown in the following figure:

Figure 13.21 – Using terraform destroy to remove eks-cluster elements
All AWS components of the Terraform IaC stack deployed are now deleted, and no charges will accrue going forward.
Notes
If you run into trouble or are simply curious to explore more regarding your EKS cluster, please be aware of the following:
Systems Manager – The SSM agent is installed and IAM policies/roles are configured such that you can connect to your EKS worker nodes via Session Manager, which is a feature of Systems Manager. If you need to connect to them directly for troubleshooting, this is a quick and easy way to do so.
CloudWatch – If you want to troubleshoot anything about the EKS cluster, you should enable CloudWatch logging. Navigate to EKS > Clusters > distributedcluster, then click the Observability tab. In the section marked Control plane logging, click Manage logging. Enable all of the slider buttons and save your changes. Now, you can view extensive Kubernetes logs in CloudWatch > Logs > Log Groups > /aws/eks/distributedcluster/cluster.
Summary
In this chapter, we ran through a hands-on exercise that deployed a set of IaC templates using Terraform. This allowed you to deploy a complex and interrelated constellation of infrastructure components in minutes – something that could have taken hours to configure by hand in the AWS Management Console.
Next, we showed you how to use another set of IaC templates to deploy a containerized distributed application that spanned an AWS Region, an AWS Local Zone, and an AWS Wavelength Zone. You can now use both IaC stacks as the basis of further development of your own distributed applications.
Finally, we gave you some pointers on how to evaluate the impact on user experience the physical location of the application entry point has.
In the next, and final, chapter, we will review the future of AWS edge computing services.