AWS CodeBuild
Developer Tools · Common, learn when you need it
A machine AWS starts for you to compile and test your code, then throws away.
Hiring a kitchen by the hour. You bring the ingredients and the recipe, cook, and leave nothing behind.
What it actually does
You give CodeBuild a buildspec.yml listing the commands to run. It starts a clean container, runs them, keeps the logs and output files, then shuts down. Every build starts fresh, so dependency downloads repeat unless you turn on caching. Builds default to no VPC access, which surprises people trying to reach a private database.
Reach for it when
- You want CI without running your own build servers
- Your build must reach AWS resources using IAM instead of stored keys
- You need a specific container image or large build machine on demand
Do not reach for it when
- Your code lives on GitHub and the team is happy there, GitHub Actions is usually simpler
- You need long running or always on build agents, use EC2 or ECS
One small example
On every push, install dependencies, run the test suite, build a Docker image and push it to ECR.
How you pay
Per build minute, by machine size. The surprise is slow builds with no cache, and ARM or GPU sizes costing far more per minute.
Usually sits next to
The real source
This is a simplified summary written for people learning AWS. The official AWS documentation is the authoritative word and it wins wherever this page disagrees with it.