class CodeBuildProject
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.Targets.CodeBuildProject |
Java | software.amazon.awscdk.services.events.targets.CodeBuildProject |
Python | aws_cdk.aws_events_targets.CodeBuildProject |
TypeScript (source) | @aws-cdk/aws-events-targets » CodeBuildProject |
Implements
IRule
Start a CodeBuild build when an Amazon EventBridge rule is triggered.
Example
import * as sns from '@aws-cdk/aws-sns';
import * as targets from '@aws-cdk/aws-events-targets';
declare const repo: codecommit.Repository;
declare const project: codebuild.PipelineProject;
declare const myTopic: sns.Topic;
// starts a CodeBuild project when a commit is pushed to the "master" branch of the repo
repo.onCommit('CommitToMaster', {
target: new targets.CodeBuildProject(project),
branches: ['master'],
});
// publishes a message to an Amazon SNS topic when a comment is made on a pull request
const rule = repo.onCommentOnPullRequest('CommentOnPullRequest', {
target: new targets.SnsTopic(myTopic),
});
Initializer
new CodeBuildProject(project: IProject, props?: CodeBuildProjectProps)
Parameters
- project
IProject
- props
Code
Build Project Props
Methods
Name | Description |
---|---|
bind(_rule, _id?) | Allows using build projects as event rule targets. |
bind(_rule, _id?)
public bind(_rule: IRule, _id?: string): RuleTargetConfig
Parameters
- _rule
IRule
- _id
string
Returns
Allows using build projects as event rule targets.