AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::CodeBuild::Project

CfnProject

The `AWS::CodeBuild::Project` resource configures how AWS CodeBuild builds your source code. For example, it tells CodeBuild where to get the source code and which build environment to use. > To unset or remove a project value via CFN, explicitly provide the attribute with value as empty input.

Import

import { CfnProject } from 'aws-cdk-lib/aws-codebuild';

Or use the module namespace:

import * as codebuild from 'aws-cdk-lib/aws-codebuild';
// codebuild.CfnProject

Properties

Configuration passed to the constructor as CfnProjectProps.

artifactsRequired
IResolvable | ArtifactsProperty

`Artifacts` is a property of the [AWS::CodeBuild::Project](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html) resource that specifies output settings for artifacts generated by an AWS CodeBuild build.

environmentRequired
IResolvable | EnvironmentProperty

The build environment settings for the project, such as the environment type or the environment variables to use for the build environment.

serviceRoleRequired
string

The ARN of the IAM role that enables AWS CodeBuild to interact with dependent AWS services on behalf of the AWS account.

sourceRequired
IResolvable | SourceProperty

The source code settings for the project, such as the source code's repository type and location.

autoRetryLimitOptional
number
badgeEnabledOptional
boolean | IResolvable

Indicates whether AWS CodeBuild generates a publicly accessible URL for your project's build badge. For more information, see [Build Badges Sample](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-badges.html) in the *AWS CodeBuild User Guide* . > Including build badges with your project is currently not supported if the source type is CodePipeline. If you specify `CODEPIPELINE` for the `Source` property, do not specify the `BadgeEnabled` property.

buildBatchConfigOptional
IResolvable | ProjectBuildBatchConfigProperty

A `ProjectBuildBatchConfig` object that defines the batch build options for the project.

cacheOptional
IResolvable | ProjectCacheProperty

Settings that AWS CodeBuild uses to store and reuse build dependencies.

concurrentBuildLimitOptional
number

The maximum number of concurrent builds that are allowed for this project. 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.

descriptionOptional
string

A description that makes the build project easy to identify.

encryptionKeyOptional
string

The AWS Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts. > You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key. You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format `alias/<alias-name>` ). If you don't specify a value, CodeBuild uses the managed CMK for Amazon Simple Storage Service (Amazon S3).

fileSystemLocationsOptional
IResolvable | IResolvable | ProjectFileSystemLocationProperty[]

An array of `ProjectFileSystemLocation` objects for a CodeBuild build project. A `ProjectFileSystemLocation` object specifies the `identifier` , `location` , `mountOptions` , `mountPoint` , and `type` of a file system created using Amazon Elastic File System.

logsConfigOptional
IResolvable | LogsConfigProperty

Information about logs for the build project. A project can create logs in CloudWatch Logs, an S3 bucket, or both.

nameOptional
string

The name of the build project. The name must be unique across all of the projects in your AWS account .

queuedTimeoutInMinutesOptional
number

The number of minutes a build is allowed to be queued before it times out.

resourceAccessRoleOptional
string

The ARN of the IAM role that enables CodeBuild to access the CloudWatch Logs and Amazon S3 artifacts for the project's builds.

secondaryArtifactsOptional
IResolvable | IResolvable | ArtifactsProperty[]

A list of `Artifacts` objects. Each artifacts object specifies output settings that the project generates during a build.

secondarySourcesOptional
IResolvable | IResolvable | SourceProperty[]

An array of `ProjectSource` objects.

secondarySourceVersionsOptional
IResolvable | IResolvable | ProjectSourceVersionProperty[]

An array of `ProjectSourceVersion` objects. If `secondarySourceVersions` is specified at the build level, then they take over these `secondarySourceVersions` (at the project level).

sourceVersionOptional
string

A version of the build input to be built for this project. If not specified, the latest version is used. If specified, it must be one of: - For CodeCommit: the commit ID, branch, or Git tag to use. - For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format `pr/pull-request-ID` (for example `pr/25` ). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. - For GitLab: the commit ID, branch, or Git tag to use. - For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used. - For Amazon S3: the version ID of the object that represents the build input ZIP file to use. If `sourceVersion` is specified at the build level, then that version takes precedence over this `sourceVersion` (at the project level). For more information, see [Source Version Sample with CodeBuild](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) in the *AWS CodeBuild User Guide* .

tagsOptional
CfnTag[]

An arbitrary set of tags (key-value pairs) for the AWS CodeBuild project. These tags are available for use by AWS services that support AWS CodeBuild build project tags.

timeoutInMinutesOptional
number

How long, in minutes, from 5 to 2160 (36 hours), for AWS CodeBuild to wait before timing out any related build that did not get marked as completed. The default is 60 minutes.

triggersOptional
IResolvable | ProjectTriggersProperty

For an existing AWS CodeBuild build project that has its source code stored in a GitHub repository, enables AWS CodeBuild to begin automatically rebuilding the source code every time a code change is pushed to the repository.

visibilityOptional
string

Specifies the visibility of the project's builds. Possible values are:. - **PUBLIC_READ** - The project builds are visible to the public. - **PRIVATE** - The project builds are not visible to the public.

vpcConfigOptional
IResolvable | VpcConfigProperty

`VpcConfig` specifies settings that enable AWS CodeBuild to access resources in an Amazon VPC. For more information, see [Use AWS CodeBuild with Amazon Virtual Private Cloud](https://docs.aws.amazon.com/codebuild/latest/userguide/vpc-support.html) in the *AWS CodeBuild User Guide* .

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the AWS CodeBuild Cheat Sheet

Everything you need to know about AWS CodeBuild on one page. HD quality, print-friendly.

Download Free Infographic