AWS CodeCommit Construct Library
This is a developer preview (public beta) module. Releases might lack important features and might have
future breaking changes.
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.',
});
To add an Amazon SNS trigger to your repository:
repo.notify('arn:aws:sns:*:123456789012:my_topic');
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:
repo.onCommit('CommitToMaster', project, 'master');
const rule = repo.onCommentOnPullRequest('CommentOnPullRequest');
rule.addTarget(myTopic);