• Guide Content

AWS ECS: Understand Launch Types, Service Options & Pricing

What Is Amazon Elastic Container Service (ECS)?

Elastic Container Service (ECS) is a fully managed solution for containerized application management. It lets you easily run your applications on Amazon Elastic Compute Cloud (Amazon EC2) instances, or via Amazon Fargate, in a single, managed cluster. 

Key capabilities of Amazon ECS include:

  • Enables you to use simple API calls to launch and stop containerized applications and query the cluster’s complete state. 
  • Supports Docker containers.
  • Provides access to AWS features such as security groups, Elastic Block Store (EBS) volumes, Identity Access Management (IAM) roles, and Elastic Load Balancing. 
  • Lets you schedule container placement across a cluster according to your availability requirements and resource needs. 
  • Allows integration with a custom or third-party scheduler to meet specific business or application requirements.

This is part of an extensive series of guides about [IaaS].

Amazon ECS Launch Types 

You can specify an Amazon ECS launch type when running individual tasks or creating services. This determines the infrastructure for hosting jobs and services. The available launch types are:

ECS on Fargate

AWS Fargate is a serverless way to host Amazon ECS workloads. You can run containerized applications using the Fargate launch type without provisioning and managing the underlying infrastructure.

The following figure shows a typical architecture.

aws ecs on fargate

ECS on EC2

As a container orchestration, ECS makes many aspects of containers and cluster management easier, but not everything.  You can use the EC2 launch type to register your Amazon ECS clusters and run containerized applications on Amazon EC2 instances that you manage yourself. When you choose to use the EC2 launch type, you maintain control over your infrastructure but are required to provision, scale, and monitor EC2 instances.

The following figure shows a typical architecture.

 

 

aws ecs ec2 Image source: AWS

Learn more in our detailed guide to AWS ECS architecture

What Is Amazon ECS Anywhere? 

Elastic Container Service (ECS) Anywhere is an Amazon ECS feature that makes it easier to run and manage container workloads on customer managed infrastructure.

ECS Anywhere extends Amazon ECS’s simplicity to the on-premise data center. It provides a consistent API and tooling experience for container-based applications—whether in the cloud or on-premises, they provide the same cluster monitoring, management, and workload scheduling as Amazon ECS. 

AWS ECS Pricing and Costs 

Amazon ECS is designed to run infrastructure in an efficient, automated, and scalable way. There is no additional charge for Amazon ECS. You pay only for the AWS resources you create to store and run your applications. There are no minimum fees or upfront obligations.

AWS ECS Pricing with EC2

There are no additional charges to get your containers up and running with Amazon Elastic Compute Cloud (EC2) and ECS. You pay only for the resources used to run the applications—for example, the underlying EBS storage volumes and EC2 instances. For more information and pricing information on Amazon EC2 instances, please visit the EC2 pricing page.

While there are no upfront or minimum fees, EC2 deployment has some drawbacks. When deploying ECS containers on EC2 instances, you must define which instance type to use and when to scale up. Customers are responsible for configuring, monitoring, maintaining, patching, and securing their underlying EC2 instances. 

Also, instance size is fixed. Therefore, you need to be confident about your container requirements in advance and avoid choosing instances that are too large or too small.

Advantages of ECS with EC2 include greater control to tailor the infrastructure to your specific requirements, such as choosing between GPU-optimized or network-optimized instances.

Learn more in our detailed guides to:

AWS ECS Pricing with Fargate

AWS Fargate charges for the compute and memory resources used by containerized applications. However, the price is slightly higher than Amazon EC2. This is because with Fargate, Amazon does the heavy lifting of configuring and managing underlying infrastructure and servers. Note that you can run Fargate on spot instances, which can reduce the cost by up to 90%, but this carries the risk of having workloads interrupted at short notice.

Fargate charges are calculated on container images pulled by ECS tasks, rounded up to the closest second. The minimum charging time is 1 minute. Fargate charges are based on:

  • The number of Amazon ECS tasks you run
  • The duration of the tasks
  • vCPUs for tasks (billed per hour)
  • The amount of memory used by jobs (billed in GB-hours)

Fargate charges a higher price compared to EC2, but allows you to focus on building and managing applications. You simply provide the resources your task needs, and Fargate starts the container. Additionally, each application is isolated by design, which improves security.

AWS ECS on Outposts

AWS Outposts are fully managed services that extend AWS infrastructure, APIs, services, and tools to customer premises. It allows organizations to develop and run applications on-premises or on hybrid infrastructure.

Amazon ECS on AWS Outposts has simple pricing and works just like it does on the cloud. The Amazon ECS control plane runs in the cloud (not on Outposts) while container instances run on Outposts EC2 capacity at no extra charge.

If your use case requires data to be kept locally or your application has stringent low-latency requirements, you can host the ECS containers on Outposts. This can be more expensive than other compute options, but is suitable for certain workloads.

Please see the Outposts pricing page for further pricing details.

Amazon ECS Anywhere Pricing

There is no upfront or minimum fee for ECS Anywhere—you pay for any running instances you manage. AWS charges $0.01025 per hour per ECS Anywhere instance on-premises. 

On-premise instances are managed by the customer, but are registered with the ECS cluster and run on the ECS container agent. See the Amazon ECS Anywhere pricing page for details.

AWS ECS with Lumigo

For all the benefits that AWS ECS brings to developing and running containers, these distributed applications still need observability to ensure they run at the highest performance, with the greatest reliability to deliver seamless customer experiences. 

Lumigo is a cloud native observability platform purpose-built for microservice applications that provides deep visibility into applications and infrastructure, enabling users to easily monitor and troubleshoot their applications running on Amazon ECS. 

  • Trace end-to-end applications running on Amazon ECS, AWS Lambda and consuming AWS services and 3rd party APIs 
  • Easily monitor and debug ECS clusters and underlying services and tasks in real-time 
  • Setup automatic alerts to notify you in Slack, Pagerduty and other workflow tools 

Get started free with Lumigo today!

See Additional Guides on Key IaaS Topics

Together with our content partners, we have authored in-depth guides on several other topics that can also be useful as you explore the world of IaaS.

AWS EFS

Authored by NetApp

AWS FSx

Authored by NetApp

Cloud Cost

Authored by Spot