Softwr

Software · head to head

AWS CodeBuild vs AWS Fargate

AWS CodeBuild logo

AWS CodeBuild

Software

Pay-per-minute managed build service for compiling, testing and packaging code

From
$0.005/minute
Free plan
No
AWS Fargate logo

AWS Fargate

Software

Serverless compute for containers on ECS and EKS, billed per vCPU and GB second

From
$0.04048/vCPU-hour
Free plan
No

The short version

  • AWS CodeBuild starts at $0.005/mo, AWS Fargate at $0.04048/mo.
  • Only AWS CodeBuild lists managed build environments; only AWS Fargate lists no servers to manage.
  • Where AWS CodeBuild falls short: billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests.
  • Where AWS Fargate falls short: steady, high-utilisation workloads cost more per vCPU than the same capacity on EC2, especially with reservations or Savings Plans.

How do AWS CodeBuild and AWS Fargate differ?

AWS CodeBuild and AWS Fargate differ on starting price ($0.005/minute against $0.04048/vCPU-hour) and pricing model. Only the attributes on which AWS CodeBuild and AWS Fargate actually diverge.

Attributes where AWS CodeBuild and AWS Fargate differ
AttributeAWS CodeBuildAWS Fargate
Starting price$0.005/minute$0.04048/vCPU-hour
Pricing modelPer build minute by instance typePer vCPU and GB second

Identical on both: free tier (No), platforms (Web, Linux, Windows).

Which features does each one have?

They share no listed features; 6 appear only for AWS CodeBuild and 6 only for AWS Fargate. 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 AWS CodeBuild

  • Managed build environments
  • Lambda and EC2 compute
  • Reserved capacity
  • Buildspec files
  • Caching
  • GitHub Actions runners

Only in AWS Fargate

  • No servers to manage
  • Per-second billing
  • Arm support
  • Fargate Spot
  • Task-level isolation
  • Windows containers

What is each one used for?

AWS CodeBuild is most often brought in for building and pushing container images to Amazon ECR from a CodePipeline stage; AWS Fargate for running web services and APIs on ECS without managing EC2 nodes. The jobs each tool is most often brought in to do.

AWS CodeBuild

  • Building and pushing container images to Amazon ECR from a CodePipeline stagenot AWS Fargate
  • Running unit tests in parallel across many ephemeral containersnot AWS Fargate
  • Self-hosted GitHub Actions runners that need IAM access to AWS resourcesnot AWS Fargate
  • Compiling for Arm using cheaper Graviton-based build instancesnot AWS Fargate

AWS Fargate

  • Running web services and APIs on ECS without managing EC2 nodesnot AWS CodeBuild
  • Scheduled batch tasks that run for minutes and then stopnot AWS CodeBuild
  • Small teams that cannot staff cluster operationsnot AWS CodeBuild
  • Burst capacity for EKS pods through Fargate profilesnot AWS CodeBuild

Where do AWS CodeBuild and AWS Fargate fall short?

AWS CodeBuild's most cited limit: billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests. AWS Fargate's: there is no GPU support, which rules it out for machine learning inference that needs accelerators. Documented limitations, not opinions. Every one is a constraint you would hit in normal use.

AWS CodeBuild

  • Each build starts from a clean environment, so dependency installs and image pulls repeat unless caching is configured, which inflates build minutes
  • Billing is rounded per minute on EC2 compute, so many short jobs cost more than their actual run time suggests
  • There is no built-in repository, pipeline UI or code review, so you need CodePipeline or a third-party system to trigger and track releases
  • Windows and larger instance types cost several times the Linux small rate, and the pricing table has dozens of instance rows to compare
  • Debugging a failed build is slower than on a local runner because you rely on logs or session manager rather than a persistent machine

AWS Fargate

  • Steady, high-utilisation workloads cost more per vCPU than the same capacity on EC2, especially with reservations or Savings Plans
  • There is no GPU support, which rules it out for machine learning inference that needs accelerators
  • Tasks cannot run privileged containers or use host-level access, which blocks some security and monitoring agents
  • Cold start for a new task takes longer than a warm EC2 node, which hurts bursty low-latency scaling
  • Rightsizing is coarse because vCPU and memory come in fixed combinations, so you can pay for memory you do not use

How much do AWS CodeBuild and AWS Fargate cost?

AWS CodeBuild starts at $0.005/mo; AWS Fargate starts at $0.04048/mo. Plan by plan below, from each vendor's own pricing page.

AWS CodeBuild

$0.005/minute
  • Linux general1.small$0.005/minute
    • 3 GB memory, 2 vCPUs
    • 100 free build minutes per month on general1.small or arm1.small
  • Linux general1.large$0.02/minute
    • 15 GB memory, 8 vCPUs
    • general1.2xlarge is $0.20 per minute
  • Lambda compute$0.00001/second
    • Billed per second from $0.00001 (1 GB Arm) to $0.0002 (10 GB x86-64)
    • Suited to short builds

AWS Fargate

$0.04048/vCPU-hour
  • Linux x86$0.04048/vcpu-hour
    • $0.000011244 per vCPU per second
    • $0.000001235 per GB of memory per second
  • Linux Arm (Graviton)$0.03238/vcpu-hour
    • $0.0000089944 per vCPU per second
    • $0.0000009889 per GB of memory per second
  • Ephemeral storage$0.00011/gb-hour
    • $0.0000000308 per GB per second beyond the included 20 GB

Which should you pick?

Choose AWS CodeBuild if

  • You need managed build environments.
  • You work on Web, Linux, Windows.
  • You also want lambda and ec2 compute.

Choose AWS Fargate if

  • You need no servers to manage.
  • You work on Web, Linux, Windows.
  • You also want per-second billing.

Questions people ask

Is AWS CodeBuild or AWS Fargate better?
It depends on the job. AWS CodeBuild fits building and pushing container images to Amazon ECR from a CodePipeline stage; AWS Fargate fits running web services and APIs on ECS without managing EC2 nodes. AWS CodeBuild starts at $0.005/minute and AWS Fargate at $0.04048/vCPU-hour.
Which is cheaper, AWS CodeBuild or AWS Fargate?
AWS CodeBuild starts at $0.005/minute and AWS Fargate at $0.04048/vCPU-hour.
Does AWS CodeBuild or AWS Fargate run on more platforms?
Both run on Web, Linux, Windows, so platform support will not decide this one for you.
What is AWS CodeBuild best used for?
AWS CodeBuild is most often used for building and pushing container images to amazon ecr from a codepipeline stage, running unit tests in parallel across many ephemeral containers, self-hosted github actions runners that need iam access to aws resources, compiling for arm using cheaper graviton-based build instances. Of those, building and pushing container images to amazon ecr from a codepipeline stage and running unit tests in parallel across many ephemeral containers are not what AWS Fargate is typically brought in for.
What can AWS CodeBuild do that AWS Fargate cannot?
AWS CodeBuild covers Managed build environments, Lambda and EC2 compute, Reserved capacity, Buildspec files. AWS Fargate covers No servers to manage, Per-second billing, Arm support, Fargate Spot.

Answered from the vendors’ own pages

AWS CodeBuild: How much does CodeBuild cost?

Linux general1.small is $0.005 per build minute, general1.medium $0.01 and general1.large $0.02, per the AWS pricing page. 100 build minutes per month on small instances are free.

AWS Fargate: How much does Fargate cost?

Linux x86 is $0.000011244 per vCPU second and $0.000001235 per GB second in us-east-1, about $0.0405 and $0.0044 per hour, per AWS.

AWS CodeBuild: Does CodeBuild replace Jenkins?

It replaces the build agents, not the orchestration. You still need CodePipeline, webhooks or another trigger for pipeline logic.

AWS Fargate: Fargate or EC2?

Fargate removes node management and costs more per unit; EC2 is cheaper for steady, well-packed workloads.

AWS CodeBuild: Can CodeBuild run GitHub Actions?

Yes. CodeBuild can act as managed runners for GitHub Actions workflows, billed at CodeBuild compute rates.

AWS Fargate: Does it work with Kubernetes?

Yes, EKS can run pods on Fargate through Fargate profiles.

Share

Related pages

Other head to heads