# Source

Source provider definition for a CodeBuild Project.

Extends: Source
Implements: ISource

- Source: [`aws-codebuild/lib/source.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-codebuild/lib/source.ts#L61)

## Example

```ts
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/**/*',
      ],
    },
  }),
});
```

## Properties

- `badgeSupported`: boolean (required)

- `identifier`: string

- `type`: string (required)

## Methods

- `bind(_scope: Construct, _project: IProject): SourceConfig` — 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.

- `bitBucket(props: BitBucketSourceProps): ISource` (static)

- `codeCommit(props: CodeCommitSourceProps): ISource` (static)

- `gitHub(props: GitHubSourceProps): ISource` (static)

- `gitHubEnterprise(props: GitHubEnterpriseSourceProps): ISource` (static)

- `s3(props: S3SourceProps): ISource` (static)
