# RepositoryProps

Extends: RepositoryProps
Used as props by: Repository

- Source: [`aws-codecommit/lib/repository.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codecommit/lib/repository.ts#L514)
- Type last changed: v2.224.0 · 13 Nov 2025

## Example

```ts
declare const project: codebuild.PipelineProject;
const repository = new codecommit.Repository(this, 'MyRepository', {
  repositoryName: 'MyRepository',
});
const project = new codebuild.PipelineProject(this, 'MyProject');

const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.CodeCommitSourceAction({
  actionName: 'CodeCommit',
  repository,
  output: sourceOutput,
});
const buildAction = new codepipeline_actions.CodeBuildAction({
  actionName: 'CodeBuild',
  project,
  input: sourceOutput,
  outputs: [new codepipeline.Artifact()], // optional
  executeBatchBuild: true, // optional, defaults to false
  combineBatchBuildArtifacts: true, // optional, defaults to false
});

new codepipeline.Pipeline(this, 'MyPipeline', {
  stages: [
    {
      stageName: 'Source',
      actions: [sourceAction],
    },
    {
      stageName: 'Build',
      actions: [buildAction],
    },
  ],
});
```

## Properties

- `code`: [Code](/cdk/api/v2/docs/aws-cdk-lib.aws_codecommit.Code.html) — The contents with which to initialize the repository after it has been created.

  **Default:** No initialization (create empty repo)

- `description`: string — A description of the repository.

  **Default:** No description.

  Use the description to identify the
  purpose of the repository.

- `kmsKey`: [IKeyRef](/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_kms.IKeyRef.html) — The customer managed key used to encrypt and decrypt the data in repository.

  **Default:** Use an AWS managed key

- `repositoryName`: string (required) — Name of the repository.

  This property is required for all CodeCommit repositories.
