EC2 builds under 5 minutes: consider Lambda for 10-60x savings since Lambda bills per second with no minimum.
Runs in your browser. No data stored.
100 build-minutes free per month (general1.small or arm1.small only)
Calculating...
ARM Graviton is 32% cheaper than x86 for same instance size. Most Linux builds run without any code changes.
Linux pricing shown. Windows is approximately 70% more expensive for general1 instances.
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.
Use arm1 instead of general1 compute type. Same performance for most workloads at 32% less cost. Change one line in buildspec.yml.
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.
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.
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.
Help your team find the cheapest CodeBuild configuration