Deploying a test application on ECS – Running Containers in AWS
- Blog
- Deploying a test application on ECS – Running Containers in AWS
It’s always fun to see what we’ve learned in action. Based on what we have explored so far, let’s get our hands dirty by deploying a test application on Amazon ECS. This time, we’ll create a newapplication that you can also use and customize beyond the scope of this chapter, as per your personal preferences – a To-Do List Manager.
We will sprinkle some data persistence elements into the application architecture to make it as close as possible to real-life usage patterns, where you would like to add new tasks and delete a few others daily. Let’s outline the main components of the application, as highlighted in Figure 7.2.
Understanding the test application architecture
To-Do List Manager is an application that allows you to manage all the tasks that you accomplish in your day-to- day routine. In this exercise, we will develop and host two features: creating new tasks and deleting the ones that are complete. You can also further extend the scope of the application and personalize it to your taste. Several application- and infrastructure-level components communicate with each other to expose task management capabilities to the end user. They can be broadly categorized into two segments – infrastructure components and application components.
Infrastructure components
These are the services that support the underlying infrastructure foundations on top of which the application runs. As always, you need a VPC, subnet, and corresponding route tables for traffic flow management. Once the user requests hit an Application Load Balancer hosted on the edge, it forwards the packets to an ECS cluster, which then returns a HTTP response, based on the type of request that was sent. As we’ve already discussed in this chapter, ECS is further composed of services, tasks, and task definitions. We will make use of all of them to host our Python-based web application in an AWS account.
As we saw in the previous chapter, A Programmatic Approach to IaC with AWS CDK, it’s very efficient to leverage existing CDK constructs to build and deploy AWS infrastructures at scale. Thisenables us to avoid investing a lot of time in writing CloudFormation templates from scratch. Therefore, we will define the entire infrastructure required in this chapter using AWS CDK.
The following are the three layers under the infrastructure segment:
Take a look at Figure 7.2 for a visual understanding of what the overall communication flow looks like:
Figure 7.2 – Infrastructure components of the To-Do List Manager application hosted on ECS
The infrastructure elements by themselves don’t support any real-life usage patterns. So, let’s dive into the application components that will breathe life into these foundational elements.
© Copyright 2024 morningfun.org