Share This Post

Amazon ECS: A Container Service

Amazon ECS: Elastic Container Service

Containers are a way of OS virtualization building block that let you run an app and its dependencies in resource-isolated processes. Containers allow to easily package an application’s code, configurations, and dependencies into building blocks that bring operational efficiency, consistency, productivity, and version control. Containers can help in ensuring applications quick deployment, reliability, and consistency regardless of deployment or any environment. Containers provide more granulated control over resources which gives infrastructure improved efficiency. Running containers in the AWS Cloud environment allows to build strong, scalable applications and services by using the AWS Cloud benefits such as availability, elasticity, security by using the pay-as-you-grow method (only pay for the resources being used/consumed).

Amazon ECS

Amazon EC2 Container Service (ECS) is a cloud computing service in Amazon Web Services (AWS) that manages and controls containers. It allows developers to manage and deploy highly scalable apps that can run on clusters (groups of servers) via APIs. By the help of simple API calls, Docker-enabled applications can be started and stopped, queried the complete state of your app, and can be accessed many familiar features such as IAM roles, security groups, load balancers, Amazon CloudWatch Events, AWS CloudFormation templates, and AWS CloudTrail logs.

Amazon has developed ECS in response to the acceptance of containerization. ECS allows a developer to stipulate rules for isolated sets of Elastic Compute Cloud (EC2) instances to increase portability and computing performance by running on top of a host OS. ECS supports Docker, an open source Linux container service.

ECS Basic Concepts

Before we dig deep further, let’s get aware with some ECS concepts and terminologies.

Cluster: A logical group of EC2 container instances where you build, shape, and operate different workloads.

Container instance: Container instance is an EC2 instance that actually runs on the ECS agent. ECS agent is also open source.

Container agent: Container agent is the agent that actually runs on EC2 instances that helps to form the ECS cluster and if ECS optimized AMI is used, it automatically installed with the agent. But if you run your own OS or AMI, then you need to install the agent manually. The container agent is also an open source and can be found here:https://github.com/aws/amazon-ecs-agent

Task definition: Is an application contains one or more containers which requires Docker images, the amount of CPU/Memory to use, ports etc. we can simply link containers here as similar to a Docker command line.

Task: An instance of a task that runs on a container instance.

Service: A service that allows to run and maintain specified instance(s) of a task definition. If a task in a service stops, the task is restarted.

Container: A Docker container that executes as a part of a task definition.

Amazon ECS Features

Running Containers Without Servers

Amazon ECS features AWS Fargate, where containers can be managed and deployed without having to provision or manage servers. By using AWS Fargate, you no need to select Amazon EC2 instance types, provisioning, and scaling clusters of VMs to run or schedule containers to maintain their availability. Fargate allows to focus on constructing and executing applications, rather than underlying infrastructure.

Everything is Containerized

Amazon ECS allows us to build any type of containerized application very easily from running apps and micro-services to batch jobs and machine learning apps. We can easily move legacy Linux or Windows apps from on-premises to cloud infrastructure and execute them as containerized apps by using Amazon ECS.

Robust and Secure

Amazon ECS launches the containers inside your own Amazon VPC and allows to use your VPC security groups and network ACLs without sharing compute resources to other customers. You can restrict access and permissions to your containers using IAM to each service and resources that a container can access. This high level of isolation helps us in building highly secure and reliable apps using Amazon ECS.

Performance at a High Scale

Amazon ECS is a technology where you can launch thousands of Docker containers in seconds using Amazon ECS without additional complexity involved.

Amazon ECS helps to containerize Machine Learning models for both training and inference purposes. With Amazon ECS, you can create Machine Learning models made up of loosely coupled and distributed services that can be positioned on any platform.

Amazon Elastic Container Service Pricing

Following are two different cost models for Amazon Elastic Container Service (ECS).

Fargate Model

With Fargate launch type model, you only pay for the vCPU and memory resources that your containerized app uses. A minimum charge of 1 minute is applied as both vCPU and memory resources are calculated from the time where your container images are pulled until the Amazon ECS Task terminates, rounded up to the nearest second.

In EC2 launch type mode, you pay for the use of AWS resources (e.g. EC2 instances or EBS volumes) which are created to store and run your app. You only have to pay for what you use, as you use it and there are no minimum fees and no upfront commitments required.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.