Class CodeBuildProject
Start a CodeBuild build when an Amazon EventBridge rule is triggered.
Inheritance
System.Object
CodeBuildProject
Implements
Namespace: Amazon.CDK.AWS.Events.Targets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CodeBuildProject : DeputyBase, IRuleTarget
Syntax (vb)
Public Class CodeBuildProject
Inherits DeputyBase
Implements IRuleTarget
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.SNS;
using Amazon.CDK.AWS.Events.Targets;
Repository repo;
PipelineProject project;
Topic myTopic;
// starts a CodeBuild project when a commit is pushed to the "main" branch of the repo
repo.OnCommit("CommitToMain", new OnCommitOptions {
Target = new CodeBuildProject(project),
Branches = new [] { "main" }
});
// publishes a message to an Amazon SNS topic when a comment is made on a pull request
var rule = repo.OnCommentOnPullRequest("CommentOnPullRequest", new OnEventOptions {
Target = new SnsTopic(myTopic)
});
Synopsis
Constructors
CodeBuildProject(IProject, ICodeBuildProjectProps) | |
CodeBuildProject(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CodeBuildProject(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(IRule, String) | Allows using build projects as event rule targets. |
Constructors
CodeBuildProject(IProject, ICodeBuildProjectProps)
public CodeBuildProject(IProject project, ICodeBuildProjectProps props = null)
Parameters
- project IProject
- props ICodeBuildProjectProps
CodeBuildProject(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CodeBuildProject(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CodeBuildProject(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CodeBuildProject(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(IRule, String)
Allows using build projects as event rule targets.
public virtual IRuleTargetConfig Bind(IRule rule, string id = null)
Parameters
- rule IRule
- id System.String
Returns