Softwr

Developer Tools · head to head

Amazon ECS vs AWS CDK

Amazon ECS logo

Amazon ECS

Developer Tools

AWS managed container orchestration, free to use, billed for Fargate or EC2 compute

From
On request
Free plan
No
AWS CDK logo

AWS CDK

Developer Tools

Open source framework for defining AWS infrastructure in programming languages

From
Free
Free plan
Yes

The short version

  • Amazon ECS is a fully managed container orchestration service on AWS; AWS CDK is an Apache 2.
  • AWS CDK is free; Amazon ECS prices on request.
  • Only Amazon ECS lists fargate serverless containers; only AWS CDK lists construct Library of reusable components.
  • Where Amazon ECS falls short: runs only on AWS, with no portability to other clouds.
  • Where AWS CDK falls short: targets AWS only, so it does not provision resources on other clouds.

How do Amazon ECS and AWS CDK differ?

Amazon ECS and AWS CDK differ on starting price (On request against Free), pricing model (Usage-based against Open-source) and free tier (No against Yes). Only the attributes on which Amazon ECS and AWS CDK actually diverge.

Attributes where Amazon ECS and AWS CDK differ
AttributeAmazon ECSAWS CDK
Starting priceOn requestFree
Pricing modelUsage-basedOpen-source
Free tierNoYes
PlatformsWebWindows, macOS, Linux

Not yet recorded: category for Amazon ECS.

Which features does each one have?

They share no listed features; 8 appear only for Amazon ECS and 8 only for AWS CDK. Drawn from each product's published feature list. An absence here means we hold no record of it - not that the product lacks it.

Only in Amazon ECS

  • Fargate serverless containers
  • EC2 launch type
  • ECS Anywhere for on-premises and edge
  • ECS Managed Instances
  • IAM-based access control
  • Automated patching
  • Encryption in transit and at rest
  • Spot capacity support

Only in AWS CDK

  • Construct Library of reusable components
  • CDK CLI for synthesis and deployment
  • Programmatic CDK Toolkit Library
  • Support for TypeScript, JavaScript, Python, Java, C# and Go
  • Deployment through AWS CloudFormation
  • Custom and shareable constructs
  • Construct Hub registry
  • Open source under Apache 2.0

What is each one used for?

Amazon ECS is most often brought in for running containerised web services on AWS; AWS CDK for defining AWS infrastructure in TypeScript or Python. The jobs each tool is most often brought in to do.

Amazon ECS

  • Running containerised web services on AWSnot AWS CDK
  • Batch jobs on Spot capacitynot AWS CDK
  • Serverless containers without managing serversnot AWS CDK
  • Hybrid workloads using ECS Anywherenot AWS CDK

AWS CDK

  • Defining AWS infrastructure in TypeScript or Pythonnot Amazon ECS
  • Reusable internal infrastructure modulesnot Amazon ECS
  • Serverless application stacksnot Amazon ECS
  • Testing infrastructure with unit testsnot Amazon ECS
  • Standardising environments across accountsnot Amazon ECS

Where do Amazon ECS and AWS CDK fall short?

Amazon ECS's most cited limit: runs only on AWS, with no portability to other clouds. AWS CDK's: targets AWS only, so it does not provision resources on other clouds. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

Amazon ECS

  • Runs only on AWS, with no portability to other clouds
  • Task definitions and APIs are AWS-specific, unlike Kubernetes
  • Costs combine ECS-adjacent services such as EC2, load balancers and IPv4
  • Smaller ecosystem of third-party tooling than Kubernetes

AWS CDK

  • Targets AWS only, so it does not provision resources on other clouds
  • Deploys through CloudFormation, so its resource coverage and limits apply
  • Infrastructure written in code can be harder to review than declarative templates
  • The AWS resources it creates are billed separately at standard AWS rates

How much do Amazon ECS and AWS CDK cost?

AWS CDK is free to use. Plan by plan below, from each vendor's own pricing page.

Amazon ECS

On request

No published plan breakdown. See the Amazon ECS review.

AWS CDK

Free

No published plan breakdown. See the AWS CDK review.

Which should you pick?

Choose Amazon ECS if

  • You need fargate serverless containers.
  • You also want ec2 launch type.

Choose AWS CDK if

  • You need construct library of reusable components.
  • You want to start without paying.
  • You work on Windows, macOS, Linux.
  • You also want cdk cli for synthesis and deployment.

Questions people ask

Is Amazon ECS or AWS CDK better?
It depends on the job. Amazon ECS fits running containerised web services on AWS; AWS CDK fits defining AWS infrastructure in TypeScript or Python. Amazon ECS starts at On request and AWS CDK at Free.
Which is cheaper, Amazon ECS or AWS CDK?
AWS CDK has a free tier; the other does not. Paid plans start at On request for Amazon ECS and Free for AWS CDK.
Does Amazon ECS or AWS CDK run on more platforms?
Amazon ECS runs on Web. AWS CDK runs on Windows, macOS, Linux.
Can I use AWS CDK for free?
Yes. AWS CDK has a free tier, so you can try it without paying. Amazon ECS starts at On request.
What is Amazon ECS best used for?
Amazon ECS is most often used for running containerised web services on aws, batch jobs on spot capacity, serverless containers without managing servers, hybrid workloads using ecs anywhere. Of those, running containerised web services on aws and batch jobs on spot capacity are not what AWS CDK is typically brought in for.
What can Amazon ECS do that AWS CDK cannot?
Amazon ECS covers Fargate serverless containers, EC2 launch type, ECS Anywhere for on-premises and edge, ECS Managed Instances. AWS CDK covers Construct Library of reusable components, CDK CLI for synthesis and deployment, Programmatic CDK Toolkit Library, Support for TypeScript, JavaScript, Python, Java, C# and Go.

Answered from the vendors’ own pages

Amazon ECS: Does ECS cost extra?

No. There is no additional charge for Amazon ECS orchestration; you pay for the compute and resources your containers use.

Source
AWS CDK: Which languages does AWS CDK support?

The AWS documentation lists TypeScript, JavaScript, Python, Java, C# and .NET, and Go. Infrastructure is defined as constructs composed into stacks and apps.

Source
Amazon ECS: Can ECS run outside AWS?

ECS Anywhere runs containers on registered on-premises instances at $0.01025 per instance per hour.

Source
AWS CDK: How does AWS CDK deploy resources?

CDK apps are synthesised and deployed through AWS CloudFormation. The documentation states this gives predictable, repeatable deployments with rollback on error.

Source
Amazon ECS: What compute options does ECS offer?

AWS Fargate, Amazon EC2 and ECS Anywhere, plus ECS Managed Instances.

Source
AWS CDK: Is AWS CDK free?

It is open source under the Apache 2.0 licence according to its GitHub repository. The AWS resources you provision with it are charged at their normal rates.

Source
AWS CDK: When was AWS CDK first released?

Wikipedia reports a developer preview announced in 2018 and general availability on 11 July 2019. CDK v2 followed in 2021.

Source
Share

Related pages

Other head to heads