The CDK Construct Library for AWS::CodeCommit
Project description
AWS CodeCommit Construct Library
---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:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.aws_codecommit as codecommit
repo = codecommit.Repository(self, "Repository",
repository_name="MyRepositoryName",
description="Some description."
)
Use the repositoryCloneUrlHttp
, repositoryCloneUrlSsh
or repositoryCloneUrlGrc
property to clone your repository.
To add an Amazon SNS trigger to your repository:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
# trigger is established for all repository actions on all branches by default.
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:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
# starts a CodeBuild project when a commit is pushed to the "master" branch of the repo
repo.on_commit("CommitToMaster",
target=targets.CodeBuildProject(project),
branches=["master"]
)
# publishes a message to an Amazon SNS topic when a comment is made on a pull request
rule = repo.on_comment_on_pull_request("CommentOnPullRequest",
target=targets.SnsTopic(my_topic)
)
CodeStar Notifications
To define CodeStar Notification rules for Repositories, use one of the notifyOnXxx()
methods.
They are very similar to onXxx()
methods for CloudWatch events:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
target = chatbot.SlackChannelConfiguration(stack, "MySlackChannel",
slack_channel_configuration_name="YOUR_CHANNEL_NAME",
slack_workspace_id="YOUR_SLACK_WORKSPACE_ID",
slack_channel_id="YOUR_SLACK_CHANNEL_ID"
)
rule = repository.notify_on_pull_request_created("NotifyOnPullRequestCreated", target)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws-cdk.aws-codecommit-1.131.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3727f0cf4db067579d5b231fb347d584b4ab343361f838c9185f5265906a72f4 |
|
MD5 | ff66c1acdee3df9e4e674851e1772b6f |
|
BLAKE2b-256 | 0e07d186c44946d4e1cb0a4299cae185e27d2a1931c5b80de2a71e5394e24cfe |
Hashes for aws_cdk.aws_codecommit-1.131.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3c00f79802e03ff5d2c83cf1a9047e2b07186408e3dd6d6c6c2b1c9f67871da |
|
MD5 | c6809ff01cb08979e30bc70553a075d9 |
|
BLAKE2b-256 | 2a579423b266a74db64fc2c0caf73b8f74f0d131f6d1387cc3f69fdcb6c17255 |