aws-cdk-lib.aws_codecommit.RepositoryProps

interface RepositoryProps

LanguageType name
.NETAmazon.CDK.AWS.CodeCommit.RepositoryProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodecommit#RepositoryProps
Javasoftware.amazon.awscdk.services.codecommit.RepositoryProps
Pythonaws_cdk.aws_codecommit.RepositoryProps
TypeScript (source)aws-cdk-lib » aws_codecommit » RepositoryProps

Example

// Source stage: read from repository
const repo = new codecommit.Repository(stack, 'TemplateRepo', {
  repositoryName: 'template-repo',
});
const sourceOutput = new codepipeline.Artifact('SourceArtifact');
const source = new cpactions.CodeCommitSourceAction({
  actionName: 'Source',
  repository: repo,
  output: sourceOutput,
  trigger: cpactions.CodeCommitTrigger.POLL,
});
const sourceStage = {
  stageName: 'Source',
  actions: [source],
};

// Deployment stage: create and deploy changeset with manual approval
const stackName = 'OurStack';
const changeSetName = 'StagedChangeSet';

const prodStage = {
  stageName: 'Deploy',
  actions: [
    new cpactions.CloudFormationCreateReplaceChangeSetAction({
      actionName: 'PrepareChanges',
      stackName,
      changeSetName,
      adminPermissions: true,
      templatePath: sourceOutput.atPath('template.yaml'),
      runOrder: 1,
    }),
    new cpactions.ManualApprovalAction({
      actionName: 'ApproveChanges',
      runOrder: 2,
    }),
    new cpactions.CloudFormationExecuteChangeSetAction({
      actionName: 'ExecuteChanges',
      stackName,
      changeSetName,
      runOrder: 3,
    }),
  ],
};

new codepipeline.Pipeline(stack, 'Pipeline', {
  stages: [
    sourceStage,
    prodStage,
  ],
});

Properties

NameTypeDescription
repositoryNamestringName of the repository.
code?CodeThe contents with which to initialize the repository after it has been created.
description?stringA description of the repository.

repositoryName

Type: string

Name of the repository.

This property is required for all CodeCommit repositories.


code?

Type: Code (optional, default: No initialization (create empty repo))

The contents with which to initialize the repository after it has been created.


description?

Type: string (optional, default: No description.)

A description of the repository.

Use the description to identify the purpose of the repository.