Create a build project in AWS CodeBuild
You can use the AWS CodeBuild console, AWS CLI, or AWS SDKs to create a build project.
Prerequisites
Before creating a build project, answer the questions in Plan a build.
Create a build project (console)
Open the AWS CodeBuild console at https://console.aws.amazon.com/codesuite/codebuild/home.
If a CodeBuild information page is displayed, choose Create build project. Otherwise, on the navigation pane, expand Build,
choose Build projects, and then choose Create build project.
Choose Create build project.
Fill in the following sections. Once complete, choose Create build
project at the bottom of the page.
Project configuration
- Project name
-
Enter a name for this build project. Build project names must be unique
across each AWS account.
- Description
-
Enter an optional description of the build project to help other users
understand what this project is used for.
- Build badge
-
(Optional) Select Enable build badge to make your
project's build status visible and embeddable. For more information,
see Build badges sample.
Build badge does not apply if your source provider is Amazon S3.
- Enable concurrent build limit
-
(Optional) If you want to limit the number of concurrent builds for this
project, perform the following steps:
-
Select Restrict number of concurrent builds this project
can start.
-
In Concurrent build limit, enter the maximum
number of concurrent builds that are allowed for this project. This
limit cannot be greater than the concurrent build limit set for the
account. If you try to enter a number greater than the account
limit, an error message is displayed.
New builds are only started if the current number of builds is less than or equal to this limit.
If the current build count meets this limit, new builds are throttled and are not run.
- Additional information
-
(Optional) For Tags, enter the name and value of any
tags that you want supporting AWS services to use. Use Add
row to add a tag. You can add up to 50 tags.
Source
- Source provider
-
Choose the source code provider
type. Use the following lists to make selections appropriate for your source
provider:
CodeBuild does not support Bitbucket Server.
- Amazon S3
-
-
Bucket
-
Choose the name of the input bucket that contains the source code.
-
S3 object key or S3 folder
-
Enter the name of the ZIP file or the path to the
folder that contains the source code. Enter a forward slash (/) to
download everything in the S3 bucket.
-
Source version
-
Enter the version ID of the object that represents the build of your
input file. For more information, seeSource version sample with AWS CodeBuild.
- CodeCommit
-
-
Repository
-
Choose the repository you want to use.
- Reference type
-
Choose Branch, Git tag, or
Commit ID to specify the version of your source
code. For more information, see Source version sample with AWS CodeBuild.
We recommend that you choose Git branch names that don't look like commit IDs,
such as 811dd1ba1aba14473856cee38308caed7190c0d or 5392f7.
This helps you avoid Git checkout collisions with actual commits.
-
Git clone depth
-
Choose to create a shallow clone with a history truncated to the
specified number of commits. If you want a full clone, choose
Full.
- Git submodules
-
Select Use Git submodules if you want to include
Git submodules in your repository.
- Bitbucket
-
-
Credential
-
Choose Default source credential or Custom
source credential and follow the
instructions to manage the default source credential or customize the source credential.
-
Connection type
-
Choose CodeConnections, OAuth, App password, or
Personal access token to connect to CodeBuild.
-
Connection
-
Select a Bitbucket connection or a Secrets Manager secret to connect through your specified connection type.
-
Repository
-
Choose Repository in my Bitbucket account
or Public repository and enter the repository URL.
-
Source version
-
Enter a branch, commit ID, tag, or reference and a commit ID. For more
information, see Source version sample with AWS CodeBuild
We recommend that you choose Git branch names that don't look like commit IDs,
such as 811dd1ba1aba14473856cee38308caed7190c0d or 5392f7.
This helps you avoid Git checkout collisions with actual commits.
-
Git clone depth
-
Choose Git clone depth to create a shallow clone
with a history truncated to the specified number of commits. If you want
a full clone, choose Full.
- Git submodules
-
Select Use Git submodules if you want to include
Git submodules in your repository.
- Build status
-
Select Report build statuses to source provider when your
builds start and finish if you want the status of your
build's start and completion reported to your source provider.
To be able to report the build status to the source provider, the user associated with the source provider must
have write access to the repo. If the user does not have write access, the build status cannot be updated. For more information, see
Source provider access.
For Status context, enter the value to be used
for the name parameter in the Bitbucket commit status. For
more information, see build in the Bitbucket API documentation.
For Target URL, enter the value to be used for
the url parameter in the Bitbucket commit status. For more
information, see build in the Bitbucket API documentation.
The status of a build triggered by a webhook is always reported to
the source provider. To have the status of a build that is started from the console or an API
call reported to the source provider, you must select this setting.
If your project's builds are triggered by a webhook, you must push a
new commit to the repo for a change to this setting to take
effect.
In Primary source webhook events, select Rebuild
every time a code change is pushed to this repository if you want
CodeBuild to build the source code every time a code change is pushed to this
repository. For more information about webhooks and filter groups, see Bitbucket webhook events.
- GitHub
-
-
Credential
-
Choose Default source credential or Custom
source credential and follow the
instructions to manage the default source credential or customize the source credential.
-
Connection type
-
Choose GitHub App, OAuth, or
Personal access token to connect to CodeBuild.
-
Connection
-
Select a GitHub connection or a Secrets Manager secret to connect through your specified connection type.
-
Repository
-
Choose Repository in my GitHub account, Public repository,
or GitHub scoped webhook and enter the repository URL.
-
Source version
-
Enter a branch, commit ID, tag, or reference and a commit ID. For more
information, see Source version sample with AWS CodeBuild
We recommend that you choose Git branch names that don't look like commit IDs,
such as 811dd1ba1aba14473856cee38308caed7190c0d or 5392f7.
This helps you avoid Git checkout collisions with actual commits.
-
Git clone depth
-
Choose Git clone depth to create a shallow clone
with a history truncated to the specified number of commits. If you want
a full clone, choose Full.
- Git submodules
-
Select Use Git submodules if you want to include
Git submodules in your repository.
- Build status
-
Select Report build statuses to source provider when your
builds start and finish if you want the status of your
build's start and completion reported to your source provider.
To be able to report the build status to the source provider, the user associated with the source provider must
have write access to the repo. If the user does not have write access, the build status cannot be updated. For more information, see
Source provider access.
For Status context, enter the value to be used
for the context parameter in the GitHub commit status. For
more information, see Create a commit status in the GitHub developer
guide.
For Target URL, enter the value to be used for
the target_url parameter in the GitHub commit status. For
more information, see Create a commit status in the GitHub developer
guide.
The status of a build triggered by a webhook is always reported to
the source provider. To have the status of a build that is started from the console or an API
call reported to the source provider, you must select this setting.
If your project's builds are triggered by a webhook, you must push a
new commit to the repo for a change to this setting to take
effect.
In Primary source webhook events, select Rebuild
every time a code change is pushed to this repository if you want
CodeBuild to build the source code every time a code change is pushed to this
repository. For more information about webhooks and filter groups, see GitHub webhook events.
- GitHub Enterprise Server
-
-
Credential
-
Choose Default source credential or Custom
source credential and follow the
instructions to manage the default source credential or customize the source credential.
-
Connection type
-
Choose CodeConnections or Personal access token to connect to CodeBuild.
-
Connection
-
Select a GitHub Enterprise connection or a Secrets Manager secret to connect through your specified connection type.
-
Repository
-
Choose Repository in my GitHub Enterprise account or
GitHub Enterprise scoped webhook and enter the repository URL.
- Source version
-
Enter a pull request, branch, commit ID, tag, or reference and a
commit ID. For more information, see Source version sample with AWS CodeBuild.
We recommend that you choose Git branch names that don't look like commit IDs,
such as 811dd1ba1aba14473856cee38308caed7190c0d or 5392f7.
This helps you avoid Git checkout collisions with actual commits.
- Git clone depth
-
Choose Git clone depth to create a shallow clone
with a history truncated to the specified number of commits. If you want
a full clone, choose Full.
- Git submodules
-
Select Use Git submodules if you want to include
Git submodules in your repository.
- Build status
-
Select Report build statuses to source provider when your
builds start and finish if you want the status of your
build's start and completion reported to your source provider.
To be able to report the build status to the source provider, the user associated with the source provider must
have write access to the repo. If the user does not have write access, the build status cannot be updated. For more information, see
Source provider access.
For Status context, enter the value to be used
for the context parameter in the GitHub commit status. For
more information, see Create a commit status in the GitHub developer
guide.
For Target URL, enter the value to be used for
the target_url parameter in the GitHub commit status. For
more information, see Create a commit status in the GitHub developer
guide.
The status of a build triggered by a webhook is always reported to
the source provider. To have the status of a build that is started from the console or an API
call reported to the source provider, you must select this setting.
If your project's builds are triggered by a webhook, you must push a
new commit to the repo for a change to this setting to take
effect.
- Insecure SSL
-
Select Enable insecure SSL to ignore SSL warnings
while connecting to your GitHub Enterprise project repository.
In Primary source webhook events, select Rebuild
every time a code change is pushed to this repository if you want
CodeBuild to build the source code every time a code change is pushed to this
repository. For more information about webhooks and filter groups, see GitHub webhook events.
- GitLab
-
-
Credential
-
Choose Default source credential or Custom
source credential and follow the
instructions to manage the default source credential or customize the source credential.
-
Connection type
-
CodeConnections is used to connect GitLab to CodeBuild.
-
Connection