AWS DevOps — Part 3 Container Services ECS & Fargate

Applications depend on a suite of software packages including Language Compiler or Interpreter — Python, Libraries — Django, or Operating Systems — Red Hat OS. Maintaining these dependencies can be difficult, replicating this disk image between machines challenging. Container services address this problem by providing miniature operating systems known as containers. Containers contain all the dependencies an application needs to run on a server, allowing for an application to be replicated many times. Since containers are self-sufficient, meaning everything you need for your application is in your container, containers can be deployed to almost any platform.
Elastic Container Service (ECS) and managed service Fargate are AWS’s solution to containers. Containers automate the deployment of new EC2 instances to create a cluster. EC2 clusters allow for applications to scale when demand changes, giving users responsive applications.
ECS
ECS utilizes Docker containers that allow applications to be deployed on any platform. This allows for lean, scalable applications that increase or decrease EC2 instances based on demand. Docker instances are stored in an Elastic Container Registry (ECR) a private image repository. Containers are deployed in clusters to EC2 instances with the ECS agent, which will register the new instances on an ECS specific EC2 AMI.
Task definitions instruct containers how to behave with JSON metadata files. Task definitions assign attributes including image name, port binding for container and host, memory & CPU requirements, environment variables, and networking information.
Services define how many tasks are needed and how they should run. Services ensure the desired number of tasks are running across all EC2 instances and can be connected to load balancers. Load balancers use dynamic port forwarding to direct internet traffic to container port. Host ports do not need to be defined, they always run on port 80, ports need to be defined when a service is created it cannot be changed afterwards.
Fargate
Fargate is AWS’s managed container service. Like other managed services, developers are not required to define servers. All the developer needs to do is define that task that manages the container and scaling behaviors. Fargate allows for quick, automatic deployment of applications using EC2 containers.
Containers and DevOps
Container services allow for quick scaling when demand for system resources change. ECS integrates with Load Balancing services to deploy the container onto EC2 instances. Fargate is the managed container service offered by AWS, tasks and services configure the attributes of how the container behaves. Containers allow for a continuous integration/deployment of applications.
The final tutorial will deal with DevOps Security (DevSec) with KMS, SSM Parameter, and STS. These services are critical to managing system security without compromising functionality.
