This documentation is for the developer preview release of the AWS CDK. Do not use this version of the AWS CDK in production. Subsequent releases of the AWS CDK will likely include breaking changes.

AWS CodeCommit

AWS CodeCommit is a version control service that enables you to privately store and manage Git repositories in the AWS cloud.

For further information on CodeCommit, see the AWS CodeCommit documentation.

To add a CodeCommit Repository to your stack:

import codecommit = require('@aws-cdk/aws-codecommit');

const repo = new codecommit.Repository(this, 'Repository' ,{
    repositoryName: 'MyRepositoryName',
    description: 'Some description.', // optional property
});

To add an Amazon SNS trigger to your repository:

// trigger is established for all repository actions on all branches by default.
repo.notify('arn:aws:sns:*:123456789012:my_topic');

AWS CodePipeline

To use a CodeCommit Repository in a CodePipeline:

import codepipeline = require('@aws-cdk/aws-codepipeline');

const pipeline = new codepipeline.Pipeline(this, 'MyPipeline', {
  pipelineName: 'MyPipeline',
});
const sourceAction = new codecommit.PipelineSourceAction({
  actionName: 'CodeCommit',
  repository: repo,
});
pipeline.addStage({
  name: 'Source',
  actions: [sourceAction],
});

You can also create the action from the Repository directly:

// equivalent to the code above:
const sourceAction = repo.toCodePipelineSourceAction({ actionName: 'CodeCommit' });

Events

CodeCommit repositories emit Amazon CloudWatch events for certain activities. Use the repo.onXxx methods to define rules that trigger on these events and invoke targets as a result:

// starts a CodeBuild project when a commit is pushed to the "master" branch of the repo
repo.onCommit('CommitToMaster', project, 'master');

// publishes a message to an Amazon SNS topic when a comment is made on a pull request
const rule = repo.onCommentOnPullRequest('CommentOnPullRequest');
rule.addTarget(myTopic);

Reference

View in Nuget

csproj:

<PackageReference Include="Amazon.CDK.AWS.CodeCommit" Version="0.25.3" />

dotnet:

dotnet add package Amazon.CDK.AWS.CodeCommit --version 0.25.3

packages.config:

<package id="Amazon.CDK.AWS.CodeCommit" version="0.25.3" />

View in Maven Central

Apache Buildr:

'software.amazon.awscdk:codecommit:jar:0.25.3'

Apache Ivy:

<dependency groupId="software.amazon.awscdk" name="codecommit" rev="0.25.3"/>

Apache Maven:

<dependency>
  <groupId>software.amazon.awscdk</groupId>
  <artifactId>codecommit</artifactId>
  <version>0.25.3</version>
</dependency>

Gradle / Grails:

compile 'software.amazon.awscdk:codecommit:0.25.3'

Groovy Grape:

@Grapes(
@Grab(group='software.amazon.awscdk', module='codecommit', version='0.25.3')
)

View in NPM

npm:

$ npm i @aws-cdk/aws-codecommit@0.25.3

package.json:

{
  "@aws-cdk/aws-codecommit": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-codecommit@0.25.3

View in NPM

npm:

$ npm i @aws-cdk/aws-codecommit@0.25.3

package.json:

{
  "@aws-cdk/aws-codecommit": "^0.25.3"
}

yarn:

$ yarn add @aws-cdk/aws-codecommit@0.25.3

CfnRepository

class @aws-cdk/aws-codecommit.CfnRepository(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.CfnRepository;
const { CfnRepository } = require('@aws-cdk/aws-codecommit');
import { CfnRepository } from '@aws-cdk/aws-codecommit';
Extends:

@aws-cdk/cdk.Resource

Parameters:
renderProperties(properties) → string => any

Overrides @aws-cdk/cdk.Resource.renderProperties()

Protected method

Parameters:properties (any) –
Return type:string => any
resourceTypeName

The CloudFormation resource type name for this resource class.

Type:string (readonly) (static)
propertyOverrides
Type:CfnRepositoryProps (readonly)
repositoryArn
Type:string (readonly)
repositoryCloneUrlHttp
Type:string (readonly)
repositoryCloneUrlSsh
Type:string (readonly)
repositoryId
Type:string (readonly)
repositoryName
Type:string (readonly)
class RepositoryTriggerProperty

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.CfnRepository.RepositoryTriggerProperty;
// CfnRepository.RepositoryTriggerProperty is an interface
import { CfnRepository.RepositoryTriggerProperty } from '@aws-cdk/aws-codecommit';
branches

CfnRepository.RepositoryTriggerProperty.Branches

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-branches

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
customData

CfnRepository.RepositoryTriggerProperty.CustomData

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-customdata

Type:string (optional)
destinationArn

CfnRepository.RepositoryTriggerProperty.DestinationArn

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-destinationarn

Type:string (optional)
events

CfnRepository.RepositoryTriggerProperty.Events

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-events

Type:@aws-cdk/cdk.Token or (string or @aws-cdk/cdk.Token)[] (optional)
name

CfnRepository.RepositoryTriggerProperty.Name

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codecommit-repository-repositorytrigger.html#cfn-codecommit-repository-repositorytrigger-name

Type:string (optional)
toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)
ref

Inherited from @aws-cdk/cdk.Referenceable

Returns a token to a CloudFormation { Ref } that references this entity based on it’s logical ID.

Type:string (readonly)
addDeletionOverride(path)

Inherited from @aws-cdk/cdk.Resource

Syntactic sugar for addOverride(path, undefined).

Parameters:path (string) – The path of the value to delete
addDependsOn(resource)

Inherited from @aws-cdk/cdk.Resource

Indicates that this resource depends on another resource and cannot be provisioned

unless the other resource has been successfully provisioned.

Parameters:resource (@aws-cdk/cdk.Resource) –
addOverride(path, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to the synthesized CloudFormation resource. To add a

property override, either use addPropertyOverride or prefix path with

“Properties.” (i.e. Properties.TopicName).

Parameters:
  • path (string) – The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
  • value (any) – The value. Could be primitive or complex.
addPropertyDeletionOverride(propertyPath)

Inherited from @aws-cdk/cdk.Resource

Adds an override that deletes the value of a property from the resource definition.

Parameters:propertyPath (string) – The path to the property.
addPropertyOverride(propertyPath, value)

Inherited from @aws-cdk/cdk.Resource

Adds an override to a resource property.

Syntactic sugar for addOverride(“Properties.<…>”, value).

Parameters:
  • propertyPath (string) – The path of the property
  • value (any) – The value
getAtt(attributeName) → @aws-cdk/cdk.CfnReference

Inherited from @aws-cdk/cdk.Resource

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility

in case there is no generated attribute.

Parameters:attributeName (string) – The name of the attribute.
Return type:@aws-cdk/cdk.CfnReference
toCloudFormation() → json

Inherited from @aws-cdk/cdk.Resource

Emits CloudFormation for this resource.

Return type:json
options

Inherited from @aws-cdk/cdk.Resource

Options for this resource, such as condition, update policy etc.

Type:@aws-cdk/cdk.ResourceOptions (readonly)
properties

Inherited from @aws-cdk/cdk.Resource

AWS resource properties.

This object is rendered via a call to “renderProperties(this.properties)”.

Protected property

Type:any (readonly)
resourceType

Inherited from @aws-cdk/cdk.Resource

AWS resource type.

Type:string (readonly)
untypedPropertyOverrides

Inherited from @aws-cdk/cdk.Resource

AWS resource property overrides.

During synthesis, the method “renderProperties(this.overrides)” is called

with this object, and merged on top of the output of

“renderProperties(this.properties)”.

Derived classes should expose a strongly-typed version of this object as

a public property called propertyOverrides.

Protected property

Type:any (readonly)
overrideLogicalId(newLogicalId)

Inherited from @aws-cdk/cdk.StackElement

Overrides the auto-generated logical ID with a specific ID.

Parameters:newLogicalId (string) – The new logical ID to use for this stack element.
prepare()

Inherited from @aws-cdk/cdk.StackElement

Automatically detect references in this StackElement

Protected method

creationStackTrace

Inherited from @aws-cdk/cdk.StackElement

Type:string[] (readonly)
logicalId

Inherited from @aws-cdk/cdk.StackElement

The logical ID for this CloudFormation stack element. The logical ID of the element

is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Type:string (readonly)
stackPath

Inherited from @aws-cdk/cdk.StackElement

Return the path with respect to the stack

Type:string (readonly)

CfnRepositoryProps (interface)

class @aws-cdk/aws-codecommit.CfnRepositoryProps

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.CfnRepositoryProps;
// CfnRepositoryProps is an interface
import { CfnRepositoryProps } from '@aws-cdk/aws-codecommit';
repositoryName

AWS::CodeCommit::Repository.RepositoryName

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-repositoryname

Type:string
repositoryDescription

AWS::CodeCommit::Repository.RepositoryDescription

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-repositorydescription

Type:string (optional)
triggers

AWS::CodeCommit::Repository.Triggers

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codecommit-repository.html#cfn-codecommit-repository-triggers

Type:@aws-cdk/cdk.Token or (RepositoryTriggerProperty or @aws-cdk/cdk.Token)[] (optional)

CommonPipelineSourceActionProps (interface)

class @aws-cdk/aws-codecommit.CommonPipelineSourceActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.CommonPipelineSourceActionProps;
// CommonPipelineSourceActionProps is an interface
import { CommonPipelineSourceActionProps } from '@aws-cdk/aws-codecommit';

Common properties for creating {@link PipelineSourceAction} -

either directly, through its constructor,

or through {@link IRepository#toCodePipelineSourceAction}.

Extends:@aws-cdk/aws-codepipeline-api.CommonActionProps
branch
Type:string (optional)
Default:‘master’
outputArtifactName

The name of the source’s output artifact.

Output artifacts are used by CodePipeline as inputs into other actions.

Type:string (optional)
Default:a name will be auto-generated
pollForSourceChanges

Whether AWS CodePipeline should poll for source changes.

If this is false, the Pipeline will use CloudWatch Events to detect source changes instead.

Type:boolean (optional)
Default:false
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

IRepository (interface)

class @aws-cdk/aws-codecommit.IRepository

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.IRepository;
// IRepository is an interface
import { IRepository } from '@aws-cdk/aws-codecommit';
Extends:@aws-cdk/cdk.IConstruct
repositoryArn

The ARN of this Repository.

Type:string (readonly)
repositoryCloneUrlHttp

The HTTP clone URL

Type:string (readonly)
repositoryCloneUrlSsh

The SSH clone URL

Type:string (readonly)
repositoryName

The human-visible name of this Repository.

Type:string (readonly)
export() → @aws-cdk/aws-codecommit.RepositoryImportProps

Exports this Repository. Allows the same Repository to be used in 2 different Stacks.

Return type:RepositoryImportProps
Abstract:Yes
onCommentOnCommit(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a comment is made on a commit.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onCommentOnPullRequest(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a comment is made on a pull request.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onCommit(name[, target[, branch]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.

Parameters:
  • name (string) –
  • target (@aws-cdk/aws-events.IEventRuleTarget (optional)) – The target of the event
  • branch (string (optional)) – The branch to monitor. Defaults to all branches.
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onEvent(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers for repository events. Use

rule.addEventPattern(pattern) to specify a filter.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onPullRequestStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a pull request state is changed.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onReferenceCreated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a reference is

created (i.e. a new branch/tag is created) to the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onReferenceDeleted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a reference is

delete (i.e. a branch/tag is deleted) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onReferenceUpdated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a reference is

updated (i.e. a commit is pushed to an existing or new branch) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Defines a CloudWatch event rule which triggers when a “CodeCommit

Repository State Change” event occurs.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

Abstract:

Yes

toCodePipelineSourceAction(props) → @aws-cdk/aws-codecommit.PipelineSourceAction

Convenience method for creating a new {@link PipelineSourceAction}.

Parameters:props (CommonPipelineSourceActionProps) – the construction properties of the new Action
Returns:the newly created {@link PipelineSourceAction}
Return type:PipelineSourceAction
Abstract:Yes
node

Inherited from @aws-cdk/cdk.IConstruct

The construct node in the scope tree.

Type:@aws-cdk/cdk.ConstructNode (readonly)
dependencyRoots

Inherited from @aws-cdk/cdk.IDependable

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)

PipelineSourceAction

class @aws-cdk/aws-codecommit.PipelineSourceAction(props)

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.PipelineSourceAction;
const { PipelineSourceAction } = require('@aws-cdk/aws-codecommit');
import { PipelineSourceAction } from '@aws-cdk/aws-codecommit';

CodePipeline Source that is provided by an AWS CodeCommit repository.

Extends:@aws-cdk/aws-codepipeline-api.SourceAction
Parameters:props (PipelineSourceActionProps) –
bind(stage, _scope)

Implements @aws-cdk/aws-codepipeline-api.Action.bind()

The method called when an Action is attached to a Pipeline.

This method is guaranteed to be called only once for each Action instance.

Protected method

Parameters:
addInputArtifact(artifact) → @aws-cdk/aws-codepipeline-api.Action

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:artifact (@aws-cdk/aws-codepipeline-api.Artifact) –
Return type:@aws-cdk/aws-codepipeline-api.Action
addOutputArtifact(name) → @aws-cdk/aws-codepipeline-api.Artifact

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Parameters:name (string) –
Return type:@aws-cdk/aws-codepipeline-api.Artifact
onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codepipeline-api.Action

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

validate() → string[]

Inherited from @aws-cdk/aws-codepipeline-api.Action

Protected method

Return type:string[]
actionName

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
category

Inherited from @aws-cdk/aws-codepipeline-api.Action

The category of the action.

The category defines which action type the owner

(the entity that performs the action) performs.

Type:@aws-cdk/aws-codepipeline-api.ActionCategory (readonly)
owner

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
provider

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service provider that the action calls.

Type:string (readonly)
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.Action

The order in which AWS CodePipeline runs this action.

For more information, see the AWS CodePipeline User Guide.

https://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:number (readonly)
scope

Inherited from @aws-cdk/aws-codepipeline-api.Action

Retrieves the Construct scope of this Action.

Only available after the Action has been added to a Stage,

and that Stage to a Pipeline.

Protected property

Type:@aws-cdk/cdk.Construct (readonly)
version

Inherited from @aws-cdk/aws-codepipeline-api.Action

Type:string (readonly)
configuration

Inherited from @aws-cdk/aws-codepipeline-api.Action

The action’s configuration. These are key-value pairs that specify input values for an action.

For more information, see the AWS CodePipeline User Guide.

http://docs.aws.amazon.com/codepipeline/latest/userguide/reference-pipeline-structure.html#action-requirements

Type:any (optional) (readonly)
region

Inherited from @aws-cdk/aws-codepipeline-api.Action

The AWS region the given Action resides in.

Note that a cross-region Pipeline requires replication buckets to function correctly.

You can provide their names with the {@link PipelineProps#crossRegionReplicationBuckets} property.

If you don’t, the CodePipeline Construct will create new Stacks in your CDK app containing those buckets,

that you will need to cdk deploy before deploying the main, Pipeline-containing Stack.

Type:string (optional) (readonly)
Default:the Action resides in the same region as the Pipeline
role

Inherited from @aws-cdk/aws-codepipeline-api.Action

The service role that is assumed during execution of action.

This role is not mandatory, however more advanced configuration

may require specifying it.

Type:@aws-cdk/aws-iam.IRole (optional) (readonly)
outputArtifact

Inherited from @aws-cdk/aws-codepipeline-api.SourceAction

Type:@aws-cdk/aws-codepipeline-api.Artifact (readonly)

PipelineSourceActionProps (interface)

class @aws-cdk/aws-codecommit.PipelineSourceActionProps

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.PipelineSourceActionProps;
// PipelineSourceActionProps is an interface
import { PipelineSourceActionProps } from '@aws-cdk/aws-codecommit';

Construction properties of the {@link PipelineSourceAction CodeCommit source CodePipeline Action}.

Extends:CommonPipelineSourceActionProps
repository

The CodeCommit repository.

Type:IRepository
branch

Inherited from @aws-cdk/aws-codecommit.CommonPipelineSourceActionProps

Type:string (optional)
Default:‘master’
outputArtifactName

Inherited from @aws-cdk/aws-codecommit.CommonPipelineSourceActionProps

The name of the source’s output artifact.

Output artifacts are used by CodePipeline as inputs into other actions.

Type:string (optional)
Default:a name will be auto-generated
pollForSourceChanges

Inherited from @aws-cdk/aws-codecommit.CommonPipelineSourceActionProps

Whether AWS CodePipeline should poll for source changes.

If this is false, the Pipeline will use CloudWatch Events to detect source changes instead.

Type:boolean (optional)
Default:false
actionName

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The physical, human-readable name of the Action.

Not that Action names must be unique within a single Stage.

Type:string
runOrder

Inherited from @aws-cdk/aws-codepipeline-api.CommonActionProps

The runOrder property for this Action.

RunOrder determines the relative order in which multiple Actions in the same Stage execute.

Type:number (optional)
Default:1

Repository

class @aws-cdk/aws-codecommit.Repository(scope, id, props)

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.Repository;
const { Repository } = require('@aws-cdk/aws-codecommit');
import { Repository } from '@aws-cdk/aws-codecommit';

Provides a CodeCommit Repository

Extends:

RepositoryBase

Parameters:
static import(scope, id, props) → @aws-cdk/aws-codecommit.IRepository

Import a Repository defined either outside the CDK, or in a different Stack

(exported with the {@link export} method).

Parameters:
  • scope (@aws-cdk/cdk.Construct) – the parent Construct for the Repository
  • id (string) – the name of the Repository Construct
  • props (RepositoryImportProps) – the properties used to identify the existing Repository
Returns:

a reference to the existing Repository

Return type:

IRepository

export() → @aws-cdk/aws-codecommit.RepositoryImportProps

Implements @aws-cdk/aws-codecommit.RepositoryBase.export()

Exports this Repository. Allows the same Repository to be used in 2 different Stacks.

Return type:RepositoryImportProps
notify(arn[, options]) → @aws-cdk/aws-codecommit.Repository

Create a trigger to notify another service to run actions on repository events.

Parameters:
  • arn (string) – Arn of the resource that repository events will notify
  • options (RepositoryTriggerOptions (optional)) – Trigger options to run actions
Return type:

Repository

repositoryArn

Implements @aws-cdk/aws-codecommit.RepositoryBase.repositoryArn()

The ARN of this Repository.

Type:string (readonly)
repositoryCloneUrlHttp

Implements @aws-cdk/aws-codecommit.RepositoryBase.repositoryCloneUrlHttp()

The HTTP clone URL

Type:string (readonly)
repositoryCloneUrlSsh

Implements @aws-cdk/aws-codecommit.RepositoryBase.repositoryCloneUrlSsh()

The SSH clone URL

Type:string (readonly)
repositoryName

Implements @aws-cdk/aws-codecommit.RepositoryBase.repositoryName()

The human-visible name of this Repository.

Type:string (readonly)
onCommentOnCommit(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a comment is made on a commit.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onCommentOnPullRequest(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a comment is made on a pull request.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onCommit(name[, target[, branch]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.

Parameters:
  • name (string) –
  • target (@aws-cdk/aws-events.IEventRuleTarget (optional)) – The target of the event
  • branch (string (optional)) – The branch to monitor. Defaults to all branches.
Return type:

@aws-cdk/aws-events.EventRule

onEvent(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers for repository events. Use

rule.addEventPattern(pattern) to specify a filter.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onPullRequestStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a pull request state is changed.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceCreated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a reference is

created (i.e. a new branch/tag is created) to the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceDeleted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a reference is

delete (i.e. a branch/tag is deleted) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceUpdated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a reference is

updated (i.e. a commit is pushed to an existing or new branch) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Defines a CloudWatch event rule which triggers when a “CodeCommit

Repository State Change” event occurs.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

toCodePipelineSourceAction(props) → @aws-cdk/aws-codecommit.PipelineSourceAction

Inherited from @aws-cdk/aws-codecommit.RepositoryBase

Convenience method for creating a new {@link PipelineSourceAction}.

Parameters:props (CommonPipelineSourceActionProps) –
Return type:PipelineSourceAction
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

RepositoryBase

class @aws-cdk/aws-codecommit.RepositoryBase(scope, id)

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.RepositoryBase;
const { RepositoryBase } = require('@aws-cdk/aws-codecommit');
import { RepositoryBase } from '@aws-cdk/aws-codecommit';

Represents a reference to a CodeCommit Repository.

If you want to create a new Repository managed alongside your CDK code,

use the {@link Repository} class.

If you want to reference an already existing Repository,

use the {@link Repository.import} method.

Extends:

@aws-cdk/cdk.Construct

Implements:

IRepository

Abstract:

Yes

Parameters:
  • scope (@aws-cdk/cdk.Construct) – The scope in which to define this construct
  • id (string) – The scoped construct ID. Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash .
export() → @aws-cdk/aws-codecommit.RepositoryImportProps

Implements @aws-cdk/aws-codecommit.IRepository.export()

Exports this Repository. Allows the same Repository to be used in 2 different Stacks.

Return type:RepositoryImportProps
Abstract:Yes
onCommentOnCommit(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onCommentOnCommit()

Defines a CloudWatch event rule which triggers when a comment is made on a commit.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onCommentOnPullRequest(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onCommentOnPullRequest()

Defines a CloudWatch event rule which triggers when a comment is made on a pull request.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onCommit(name[, target[, branch]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onCommit()

Defines a CloudWatch event rule which triggers when a commit is pushed to a branch.

Parameters:
  • name (string) –
  • target (@aws-cdk/aws-events.IEventRuleTarget (optional)) – The target of the event
  • branch (string (optional)) – The branch to monitor. Defaults to all branches.
Return type:

@aws-cdk/aws-events.EventRule

onEvent(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onEvent()

Defines a CloudWatch event rule which triggers for repository events. Use

rule.addEventPattern(pattern) to specify a filter.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onPullRequestStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onPullRequestStateChange()

Defines a CloudWatch event rule which triggers when a pull request state is changed.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceCreated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onReferenceCreated()

Defines a CloudWatch event rule which triggers when a reference is

created (i.e. a new branch/tag is created) to the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceDeleted(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onReferenceDeleted()

Defines a CloudWatch event rule which triggers when a reference is

delete (i.e. a branch/tag is deleted) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onReferenceUpdated(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onReferenceUpdated()

Defines a CloudWatch event rule which triggers when a reference is

updated (i.e. a commit is pushed to an existing or new branch) from the repository.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

onStateChange(name[, target[, options]]) → @aws-cdk/aws-events.EventRule

Implements @aws-cdk/aws-codecommit.IRepository.onStateChange()

Defines a CloudWatch event rule which triggers when a “CodeCommit

Repository State Change” event occurs.

Parameters:
Return type:

@aws-cdk/aws-events.EventRule

toCodePipelineSourceAction(props) → @aws-cdk/aws-codecommit.PipelineSourceAction

Implements @aws-cdk/aws-codecommit.IRepository.toCodePipelineSourceAction()

Convenience method for creating a new {@link PipelineSourceAction}.

Parameters:props (CommonPipelineSourceActionProps) –
Return type:PipelineSourceAction
repositoryArn

Implements @aws-cdk/aws-codecommit.IRepository.repositoryArn()

The ARN of this Repository.

Type:string (readonly) (abstract)
repositoryCloneUrlHttp

Implements @aws-cdk/aws-codecommit.IRepository.repositoryCloneUrlHttp()

The HTTP clone URL

Type:string (readonly) (abstract)
repositoryCloneUrlSsh

Implements @aws-cdk/aws-codecommit.IRepository.repositoryCloneUrlSsh()

The SSH clone URL

Type:string (readonly) (abstract)
repositoryName

Implements @aws-cdk/aws-codecommit.IRepository.repositoryName()

The human-visible name of this Repository.

Type:string (readonly) (abstract)
prepare()

Inherited from @aws-cdk/cdk.Construct

Perform final modifications before synthesis

This method can be implemented by derived constructs in order to perform

final changes before synthesis. prepare() will be called after child

constructs have been prepared.

This is an advanced framework feature. Only use this if you

understand the implications.

Protected method

toString() → string

Inherited from @aws-cdk/cdk.Construct

Returns a string representation of this construct.

Return type:string
validate() → string[]

Inherited from @aws-cdk/cdk.Construct

Validate the current construct.

This method can be implemented by derived constructs in order to perform

validation logic. It is called on all constructs before synthesis.

Protected method

Returns:An array of validation error messages, or an empty array if there the construct is valid.
Return type:string[]
dependencyRoots

Inherited from @aws-cdk/cdk.Construct

The set of constructs that form the root of this dependable

All resources under all returned constructs are included in the ordering

dependency.

Type:@aws-cdk/cdk.IConstruct[] (readonly)
node

Inherited from @aws-cdk/cdk.Construct

Construct node.

Type:@aws-cdk/cdk.ConstructNode (readonly)

RepositoryEventTrigger (enum)

class @aws-cdk/aws-codecommit.RepositoryEventTrigger

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.RepositoryEventTrigger;
const { RepositoryEventTrigger } = require('@aws-cdk/aws-codecommit');
import { RepositoryEventTrigger } from '@aws-cdk/aws-codecommit';

Repository events that will cause the trigger to run actions in another service.

All
UpdateRef
CreateRef
DeleteRef

RepositoryImportProps (interface)

class @aws-cdk/aws-codecommit.RepositoryImportProps

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.RepositoryImportProps;
// RepositoryImportProps is an interface
import { RepositoryImportProps } from '@aws-cdk/aws-codecommit';

Properties for the {@link Repository.import} method.

repositoryName

The name of an existing CodeCommit Repository that we are referencing.

Must be in the same account and region as the root Stack.

Type:string

RepositoryProps (interface)

class @aws-cdk/aws-codecommit.RepositoryProps

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.RepositoryProps;
// RepositoryProps is an interface
import { RepositoryProps } from '@aws-cdk/aws-codecommit';
repositoryName

Name of the repository. This property is required for all repositories.

Type:string
description

A description of the repository. Use the description to identify the

purpose of the repository.

Type:string (optional)

RepositoryTriggerOptions (interface)

class @aws-cdk/aws-codecommit.RepositoryTriggerOptions

Language-specific names:

using Amazon.CDK.AWS.CodeCommit;
import software.amazon.awscdk.services.codecommit.RepositoryTriggerOptions;
// RepositoryTriggerOptions is an interface
import { RepositoryTriggerOptions } from '@aws-cdk/aws-codecommit';

Creates for a repository trigger to an SNS topic or Lambda function.

branches

The names of the branches in the AWS CodeCommit repository that contain

events that you want to include in the trigger. If you don’t specify at

least one branch, the trigger applies to all branches.

Type:string[] (optional)
customData

When an event is triggered, additional information that AWS CodeCommit

includes when it sends information to the target.

Type:string (optional)
events

The repository events for which AWS CodeCommit sends information to the

target, which you specified in the DestinationArn property.If you don’t

specify events, the trigger runs for all repository events.

Type:RepositoryEventTrigger[] (optional)
name

A name for the trigger.Triggers on a repository must have unique names

Type:string (optional)