class Source
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.CodeBuild.Source |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#Source |
Java | software.amazon.awscdk.services.codebuild.Source |
Python | aws_cdk.aws_codebuild.Source |
TypeScript (source) | aws-cdk-lib » aws_codebuild » Source |
Implements
ISource
Source provider definition for a CodeBuild Project.
Example
declare const myCachingBucket: s3.Bucket;
new codebuild.Project(this, 'Project', {
source: codebuild.Source.bitBucket({
owner: 'awslabs',
repo: 'aws-cdk',
}),
cache: codebuild.Cache.bucket(myCachingBucket),
// BuildSpec with a 'cache' section necessary for S3 caching. This can
// also come from 'buildspec.yml' in your source.
buildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
phases: {
build: {
commands: ['...'],
},
},
cache: {
paths: [
// The '**/*' is required to indicate all files in this directory
'/root/cachedir/**/*',
],
},
}),
});
Initializer (protected)
super(props: SourceProps)
Parameters
- props
SourceProps
Properties
| Name | Type | Description |
|---|---|---|
| badge | boolean | |
| type | string | |
| identifier? | string |
badgeSupported
Type:
boolean
type
Type:
string
identifier?
Type:
string
(optional)
Methods
| Name | Description |
|---|---|
| bind(_scope, _project) | Called by the project when the source is added so that the source can perform binding operations on the source. |
| static bit | |
| static code | |
| static git | |
| static git | |
| static s3(props) |
bind(_scope, _project)
public bind(_scope: Construct, _project: IProject): SourceConfig
Parameters
Returns
Called by the project when the source is added so that the source can perform binding operations on the source.
For example, it can grant permissions to the code build project to read from the S3 bucket.
static bitBucket(props)
public static bitBucket(props: BitBucketSourceProps): ISource
Parameters
- props
BitBucket Source Props
Returns
static codeCommit(props)
public static codeCommit(props: CodeCommitSourceProps): ISource
Parameters
- props
CodeCommit Source Props
Returns
static gitHub(props)
public static gitHub(props: GitHubSourceProps): ISource
Parameters
- props
GitHub Source Props
Returns
static gitHubEnterprise(props)
public static gitHubEnterprise(props: GitHubEnterpriseSourceProps): ISource
Parameters
Returns
static s3(props)
public static s3(props: S3SourceProps): ISource
Parameters
- props
S3Source Props
Returns

.NET
Go
Java
Python
TypeScript (