DevCost Tools
Free 2026 Pricing EC2 + Lambda

AWS CodeBuild Cost Calculator

Calculate exact AWS CodeBuild costs for EC2 and Lambda compute. Compare ARM vs x86, Linux vs Windows, and find the cheapest configuration for your build pipeline.

Compute Mode

EC2 builds under 5 minutes: consider Lambda for 10-60x savings since Lambda bills per second with no minimum.

EC2 Compute Type
Enable Docker Image Server
+$0.005/min — speeds up Docker builds 98%
Build Configuration
10 min
1 min 30 60 min
10 / day
1255075100
22 days

Runs in your browser. No data stored.

Cost Summary
EC2 Linux x86
Per Build
$0.00
Monthly
$0.00
Yearly
$0.00
Free Tier Used
0%
Free tier usage 0 / 100 min used

100 build-minutes free per month (general1.small or arm1.small only)

Build compute cost $0.00
Total builds/month
0
Total build time/month
0 min
Rate per minute
$0.005/min
Billing unit
Minute (1 min min)
EC2 vs Lambda — Same Build Duration
EC2 general1.small
$0.00
per month
$0.005/min — 1 min minimum
Lambda arm.2GB
Per sec
$0.00
per month
$0.00001/sec -

Calculating...

ARM Graviton vs x86 — EC2 Compute
x86 general1.small
$0.00
per month
$0.005/min
ARM arm1.small -32%
$0.00
per month
$0.0034/min Save $0.00

ARM Graviton is 32% cheaper than x86 for same instance size. Most Linux builds run without any code changes.

All EC2 Instance Sizes — Monthly Cost Comparison

Linux pricing shown. Windows is approximately 70% more expensive for general1 instances.

GitHub Actions vs AWS CodeBuild — Same Workflow
GitHub Actions Pro
$0.00
per month (incl. plan)
$0.006/min Linux + $4/mo plan
CodeBuild general1.small
$0.00
per month (no plan cost)
$0.005/min Linux -

CodeBuild wins for AWS-native projects due to direct S3, ECR, and CodePipeline integration. GitHub Actions wins for open-source and GitHub-hosted code with better marketplace ecosystem.

Cost Optimization Tips
Switch to ARM Graviton Save 32%

Use arm1 instead of general1 compute type. Same performance for most workloads at 32% less cost. Change one line in buildspec.yml.

environment: compute-type: BUILD_GENERAL1_SMALL # change to ARM1_SMALL image: aws/codebuild/amazonlinux2-aarch64-standard:3.0
Use Lambda compute for short builds Per second billing

Builds under 5 minutes are dramatically cheaper on Lambda compute because there is no 1-minute rounding. A 45-second build on EC2 bills 1 full minute. On Lambda it bills exactly 45 seconds.

environment: compute-type: LAMBDA_1GB # or LAMBDA_ARM_2GB
Enable Docker Image Server for container builds 98% faster pulls

Docker Image Server caches Docker images locally so you avoid re-pulling from ECR or DockerHub on every build. Costs $0.005/min extra but saves 5-10 minutes of Docker pull time per build — easily pays for itself on image-heavy pipelines.

Cache dependencies in S3 Reduce build time

CodeBuild supports built-in S3 caching for npm, pip, Gradle, and Maven. Enable it in buildspec.yml to avoid re-downloading dependencies on every build — typically saves 2-5 minutes per build.

cache: paths: - '/root/.m2/**/*' - '/root/.npm/**/*'
Share this tool

Help your team find the cheapest CodeBuild configuration

AWS CodeBuild Full Pricing Reference — 2026 (us-east-1)
Official AWS Pricing
EC2 Compute — Per Minute
Instance Specs Linux Windows
arm1.small 3GB/2vCPU $0.0034 N/A
general1.small 3GB/2vCPU $0.005 N/A
general1.medium 7GB/4vCPU $0.010 $0.017
general1.large 15GB/8vCPU $0.020 $0.034
general1.xlarge 72GB/36vCPU $0.0798 $0.16
general1.2xlarge 145GB/72vCPU $0.14 N/A
gpu1.large 255GB/32vCPU $0.70 N/A
Lambda Compute — Per Second
Type Memory Rate/sec
lambda.x86-64.1GB 1 GB $0.00001
lambda.x86-64.2GB 2 GB $0.00002
lambda.x86-64.4GB 4 GB $0.00004
lambda.arm.1GB 1 GB $0.000005
lambda.arm.2GB 2 GB $0.00001
lambda.arm.4GB 4 GB $0.00002
EC2 free tier100 min/month (small only)
Lambda free tier6,000 seconds/month
Docker Image Server+$0.005/min

Prices shown for us-east-1. Other regions vary. EC2 builds billed per minute rounded up. Lambda billed per second rounded up. Free tier applies permanently.

Frequently Asked Questions

Use Lambda compute when your builds complete in under 5 minutes. Lambda bills per second with no minimum, while EC2 rounds up to the nearest minute. A 30-second build on EC2 costs 1 full minute ($0.005). The same build on Lambda ARM 2GB costs 30 seconds ($0.0003) — 16x cheaper. Lambda also starts faster with no warm-up delay. The tradeoff is Lambda has lower memory limits and does not support Docker-in-Docker builds.
For Linux builds, CodeBuild general1.small costs $0.005/min versus GitHub Actions $0.006/min — so CodeBuild is slightly cheaper per minute. However GitHub Actions gives 2,000-3,000 free minutes per month while CodeBuild gives only 100. For teams with low build volume, GitHub Actions free tier is more valuable. For high-volume builds deeply integrated with AWS (deploying to EC2, ECS, Lambda), CodeBuild is better due to native IAM and service integration without needing separate credentials.
AWS CodeBuild offers 100 build minutes per month for EC2 compute (general1.small or arm1.small only) and 6,000 build seconds per month for Lambda compute (lambda.x86-64.1GB or lambda.arm.1GB only). This free tier never expires — it is available to every AWS account every month indefinitely, not just for the first 12 months. It does not apply to larger instance sizes, Reserved Capacity, or the Docker Image Server feature.
The Docker Image Server caches Docker images locally so builds do not re-pull images from ECR or Docker Hub on every run. AWS claims it reduces image pull time by up to 98%. If your builds spend 5-10 minutes pulling Docker images, enabling the server at $0.005/min extra saves that pull time — often 5x the cost of the feature itself. It makes most sense for large Docker images pulled on every build. For builds that do not use Docker or use very small images, it adds cost without benefit.
This calculator uses AWS official pricing for us-east-1. EC2 builds are billed per minute rounded up to the nearest minute — a 61-second build bills 2 minutes. Lambda builds are billed per second rounded up to the nearest second. Actual costs may vary by region. Data transfer costs and S3 cache storage are not included. Always verify against your AWS Cost Explorer for exact billing.

More Developer Cost Calculators