30% off every course until Sunday, October 11. Our biggest update yet, and we'd like you to try it. Applied automatically at checkout.

Choose your certification
Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.3.2. AWS CodeBuild for Builds & Tests

First Principle: AWS CodeBuild provides a scalable, on-demand build environment for developers, automating the compilation, testing, and packaging of application code within CI/CD pipelines.

CodeBuild compiles your code, runs tests, and produces deployment artifacts, all defined in buildspec.yml — a YAML file in your repo root that specifies what happens during the build.

The build runs in four phases: install (dependencies), pre_build (setup like ECR login), build (compile and run unit tests), and post_build (package artifacts, notifications). The exam frequently asks which phase handles which task — unit tests run in build, not a separate step.

CodeBuild runs in managed Docker containers with pre-configured runtimes, or you provide a custom image. Outputs go to S3 as artifacts that CodeDeploy picks up for deployment. Enable dependency caching to avoid re-downloading npm modules or Maven repos on every build. The dependencies themselves are declared in a manifest (package.json, requirements.txt, pom.xml) and installed by the package manager in the install phase. They are not committed to the repo or installed globally on the build image.

Scenario: You need to automate the process of compiling your application's source code, running unit tests, and packaging the output into a deployable artifact (e.g., a .zip file or a Docker image) as part of your CI pipeline.

⚠️ Exam Trap: CodeBuild uses a buildspec.yml file — not buildspec.yaml, not build.yml. If this file is missing or misconfigured, the build fails immediately. The exam tests whether you know the correct filename and structure.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications