CodeBuild Artifact Pipeline
Build a CodeBuild project end-to-end: KMS-encrypted artifact bucket, scoped service role, buildspec with dependency caching and JUnit reports, then trigger builds and debug a failing test.

Lab Overview
In this lab you will stand up a complete AWS CodeBuild pipeline that compiles a small Node.js application, runs unit tests, caches dependencies, publishes JUnit test reports to a CodeBuild report group, and stores build artifacts in an S3 bucket encrypted with a customer-managed KMS key.
You will:
- Create a KMS customer-managed key and a tagged S3 artifact bucket
- Create a CodeBuild service role scoped to S3, KMS, Logs, and CodeBuild Reports
- Author a `buildspec.yml` with install, build, test, and reports phases plus an S3 dependency cache
- Upload source to S3 and create the CodeBuild project pointing at it
- Trigger a build, watch logs, and inspect the report group and artifact outputs
- Introduce a failing unit test, observe the failure surface in the report group, then fix it and re-run
Region: `us-east-1`. Instance type: `t3.small` workstation. All resources are tagged `lab=true,Course=dop-c02` so the cleanup script can sweep them on lab stop.
What You'll Learn
Create a KMS customer-managed key and an S3 artifact bucket with SSE-KMS default encryption
Create a least-privilege CodeBuild service role scoped to S3, KMS, Logs, and Reports
Author a buildspec.yml with install/build/test phases, S3 dependency cache, and JUnit reports
Create a CodeBuild project from the AWS CLI pointing at S3-hosted source
Trigger and monitor a CodeBuild run and locate artifacts in S3
Diagnose a failing build by inspecting the CodeBuild report group, then fix and re-run
Prerequisites
basic-aws-cli-familiarity
aws-associate-level-knowledge
completed-aws-devops-cli-operations-baseline-lab
Technologies Covered
Part of a Course
This lab is part of the AWS Certified DevOps Engineer - Professional (DOP-C02) course
View All CoursesChoose your plan
Simple, Transparent Pricing
Unlock full access to TeKanAid courses, labs, and bootcamps
Just exploring? Start free below. Want the full experience? Try Premium free for 7 days (card required, $0 today).
Pro
All courses, with lab scripts to run on your own machine
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Full access to all courses
- Lab scripts to download and run on your own machine (hosted labs not included)
- Progress tracking
- Certificate of completion
- Community access
- Self-paced bootcamps
- Premium puzzle library not included (5 free puzzles available)
- New content access
Premium
Full access, including unlimited hosted labs
Renews automatically. Cancel anytime.
Final price verified at checkout.
- Everything in Pro
- Unlimited hands-on labs, fully hosted on TeKanAid Academy (nothing to set up)
- Full access to the puzzle library
- Lab AI Assistant
- Priority support
Prefer a single course?
Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.
Browse CoursesJust exploring? Start free, no account needed
Three free ways to start. All bridge into the paid Premium catalog when you're ready.
Not ready to commit? The crash course is email-only. No academy account required.
Ready to Get Started?
Start this hands-on lab and build real-world Platform Engineering skills
Get Access Now