AWS CodeBuild

Fully managed build service that compiles code, runs tests, and produces deploy-ready artifacts — no build servers to manage.

Verified against AWS documentation · 2026-08-28

Key facts

  1. 01Serverless CI: you don't provision, patch, or scale build servers — builds run in fresh, ephemeral containers that are thrown away after every run
  2. 02buildspec.yml defines the build — phases (install, pre_build, build, post_build), commands, environment variables, and artifact output, living in the repo root
  3. 03Sources: GitHub, GitHub Enterprise, Bitbucket, CodeCommit, or S3; artifacts typically land in S3 or ECR (Docker images)
  4. 04Scales automatically and runs builds concurrently — no build queue when traffic spikes, unlike a single Jenkins box
  5. 05Can run inside your VPC to reach private resources (internal RDS for integration tests, private package repos)

Exam triggers

Phrases and scenarios that point here.

  • "Compile", "run unit tests", "produce build artifacts", "no servers to manage for CI"
  • Jenkins maintenance pain / build server patching → replace with CodeBuild
  • Build stage inside a CodePipeline pipeline → the build action is CodeBuild
  • Build needs access to resources in a private subnet → CodeBuild with VPC configuration
  • Build Docker images and push to ECR → CodeBuild with privileged mode

Not this service

  • Orchestrating the whole release flow (source → build → deploy stages) → CodePipeline
  • Deploying artifacts to EC2, Lambda, or ECS → CodeDeploy
  • Full platform that builds AND runs the app for you → Elastic Beanstalk

Use cases

  1. 01Replacing a self-managed Jenkins server — the classic 'our build box died on release day' problem disappears because every build gets a fresh managed environment
  2. 02Building and pushing Docker images to ECR as part of a container deployment pipeline
  3. 03Running the test suite on every pull request via webhook, so broken code is caught before merge instead of after deploy
  4. 04Integration tests against a private database — CodeBuild joins the VPC, hits the internal RDS endpoint, no public exposure needed
  5. 05Monorepo teams running many concurrent builds — CodeBuild parallelizes instead of queueing like a fixed-size build server would

How it's charged

  1. 01Pay per build duration — EC2 compute is billed per minute (rounded up), Lambda compute per second, so a 10-second build on EC2 still costs a full minute
  2. 02Rate depends on compute type: bigger instances (more vCPU/memory) and Windows cost more per minute; ARM (Graviton) is meaningfully cheaper than x86
  3. 03No charge when nothing is building — no idle cost, which is the whole economic argument versus an always-on Jenkins EC2 instance
  4. 04Free tier doesn't expire after 12 months: monthly free build minutes on the smallest EC2 compute types plus free Lambda build seconds
  5. 05Watch the side costs: S3 artifact storage, CloudWatch Logs, and NAT Gateway charges for VPC-connected builds are billed separately

Commonly confused with

References