AWS CodeBuild
User Guide (API Version 2016-10-06)

CodeBuild Use Case-Based Samples

You can use these use case-based samples to experiment with AWS CodeBuild:

Name Description
Amazon ECR Sample Uses a Docker image in an Amazon ECR repository to use Apache Maven to produce a single JAR file.
Private Registry with AWS Secrets Manager Sample Shows how to use a Docker image in a private registry as the runtime environment when building with CodeBuild The private registry credentials are stored in AWS Secrets Manager.
Create a Test Report Using the AWS CLI Sample Uses the AWS CLI to create, run, and view the results of a test report.
Runtime Versions in Buildspec File Sample Shows how to specify runtimes and their versions in the buildspec file. This is a requirement when using the Ubuntu standard image version 2.0.
Source Version Sample Shows how to use a specific version of your source in a CodeBuild build project.
Docker Sample Uses a build image provided by CodeBuild with Docker support to produce a Docker image with Apache Maven. Pushes the Docker image to a repository in Amazon ECR. You can also adapt this sample to push the Docker image to Docker Hub.
Amazon EFS Sample Shows how to configure a buildspec file so that a CodeBuild project mounts and builds on an Amazon EFS file system.
GitHub Enterprise Sample Uses CodeBuild with GitHub Enterprise as the source repository, with certificates installed and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.
GitHub Pull Request and Webhook Filter Sample Uses CodeBuild with GitHub as the source repository and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.
Bitbucket Pull Request and Webhook Filter Sample Uses CodeBuild with Bitbucket as the source repository and webhooks enabled, to rebuild the source code every time a code change is pushed to the repository.
Use AWS Config with AWS CodeBuild Sample Shows how to set up AWS Config. Lists which CodeBuild resources are tracked and describes how to look up CodeBuild projects in AWS Config.
Host Build Output in an Amazon S3 Bucket Shows how to create a static website in an Amazon S3 bucket using unencrypted build artifacts.
Access Token Sample Shows how to use access tokens in CodeBuild to connect to GitHub and Bitbucket.
Multiple Input Sources and Output Artifacts Sample Shows how to use multiple input sources and multiple output artifacts in a build project.
CodePipeline Integration with Multiple Input Sources and Output Artifacts Sample Shows how to use AWS CodePipeline to create a build with multiple input sources and multiple output artifacts.
Build Badges Sample Shows how to set up CodeBuild with build badges.
Using Semantic Versioning to Name Build Artifacts Sample Shows how to use semantic versioning to create an artifact name at build time.
Build Notifications Sample Uses Apache Maven to produce a single JAR file. Sends a build notification to subscribers of an Amazon SNS topic.
Docker in Custom Image Sample Uses a custom Docker image to produce a Docker image.
CodeDeploy Sample Uses Apache Maven to produce a single JAR file. Uses CodeDeploy to deploy the JAR file to an Amazon Linux instance. You can also use CodePipeline to build and deploy the sample.
AWS Lambda Sample Uses CodeBuild, Lambda, AWS CloudFormation, and CodePipeline to build and deploy a serverless application that follows the AWS Serverless Application Model (AWS SAM) standard.
Elastic Beanstalk Sample Uses Apache Maven to produce a single WAR file. Uses Elastic Beanstalk to deploy the WAR file to an Elastic Beanstalk instance.