# CodeCommitSourceProps

Construction properties for `CodeCommitSource`.

Extends: [SourceProps](/cdk/api/v2/docs/aws-cdk-lib.aws_codebuild.SourceProps.html)

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

## Example

TypeScript:

```ts
import * as codecommit from 'aws-cdk-lib/aws-codecommit';
declare const repo: codecommit.Repository;
declare const bucket: s3.Bucket;

const project = new codebuild.Project(this, 'MyProject', {
  secondarySources: [
    codebuild.Source.codeCommit({
      identifier: 'source2',
      repository: repo,
    }),
  ],
  secondaryArtifacts: [
    codebuild.Artifacts.s3({
      identifier: 'artifact2',
      bucket: bucket,
      path: 'some/path',
      name: 'file.zip',
    }),
  ],
  // ...
});
```

Python:

```python
import aws_cdk.aws_codecommit as codecommit
# repo: codecommit.Repository
# bucket: s3.Bucket

project = codebuild.Project(self, "MyProject",
    secondary_sources=[
        codebuild.Source.code_commit(
            identifier="source2",
            repository=repo
        )
    ],
    secondary_artifacts=[
        codebuild.Artifacts.s3(
            identifier="artifact2",
            bucket=bucket,
            path="some/path",
            name="file.zip"
        )
    ]
)
```

Java:

```java
import software.amazon.awscdk.services.codecommit.*;
Repository repo;
Bucket bucket;

Project project = Project.Builder.create(this, "MyProject")
        .secondarySources(List.of(Source.codeCommit(CodeCommitSourceProps.builder()
                .identifier("source2")
                .repository(repo)
                .build())))
        .secondaryArtifacts(List.of(Artifacts.s3(S3ArtifactsProps.builder()
                .identifier("artifact2")
                .bucket(bucket)
                .path("some/path")
                .name("file.zip")
                .build())))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.CodeCommit;
Repository repo;
Bucket bucket;

var project = new Project(this, "MyProject", new ProjectProps {
    SecondarySources = new [] { Source.CodeCommit(new CodeCommitSourceProps {
        Identifier = "source2",
        Repository = repo
    }) },
    SecondaryArtifacts = new [] { Artifacts.S3(new S3ArtifactsProps {
        Identifier = "artifact2",
        Bucket = bucket,
        Path = "some/path",
        Name = "file.zip"
    }) }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import codecommit "github.com/aws/aws-cdk-go/awscdk"
var repo Repository
var bucket Bucket

project := codebuild.NewProject(this, jsii.String("MyProject"), &ProjectProps{
	SecondarySources: []ISource{
		codebuild.Source_CodeCommit(&CodeCommitSourceProps{
			Identifier: jsii.String("source2"),
			Repository: repo,
		}),
	},
	SecondaryArtifacts: []IArtifacts{
		codebuild.Artifacts_S3(&S3ArtifactsProps{
			Identifier: jsii.String("artifact2"),
			Bucket: bucket,
			Path: jsii.String("some/path"),
			Name: jsii.String("file.zip"),
		}),
	},
})
```

## Properties

- `branchOrRef`: string — The commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build.

  **Default:** the default branch's HEAD commit ID is used

  ```ts
  'mybranch'
  ```

- `cloneDepth`: number — The depth of history to download.

  Minimum value is 0.
  If this value is 0, greater than 25, or not provided,
  then the full history is downloaded with each build of the project.

- `fetchSubmodules`: boolean = false — Whether to fetch submodules while cloning git repo.

- `identifier`: string — The source identifier.

  This property is required on secondary sources.

- `repository`: [IRepository](/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.IRepository.html) (required)
