Class CodeBuildProject

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.CodeBuildProject
All Implemented Interfaces:
IRuleTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.718Z") @Stability(Stable) public class CodeBuildProject extends software.amazon.jsii.JsiiObject implements IRuleTarget
Start a CodeBuild build when an Amazon EventBridge rule is triggered.

Example:

 import software.amazon.awscdk.services.sns.*;
 import software.amazon.awscdk.services.events.targets.*;
 Repository repo;
 PipelineProject project;
 Topic myTopic;
 // starts a CodeBuild project when a commit is pushed to the "master" branch of the repo
 repo.onCommit("CommitToMaster", OnCommitOptions.builder()
         .target(new CodeBuildProject(project))
         .branches(List.of("master"))
         .build());
 // publishes a message to an Amazon SNS topic when a comment is made on a pull request
 Rule rule = repo.onCommentOnPullRequest("CommentOnPullRequest", OnEventOptions.builder()
         .target(new SnsTopic(myTopic))
         .build());
 
  • Constructor Details

    • CodeBuildProject

      protected CodeBuildProject(software.amazon.jsii.JsiiObjectRef objRef)
    • CodeBuildProject

      protected CodeBuildProject(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CodeBuildProject

      @Stability(Stable) public CodeBuildProject(@NotNull IProject project, @Nullable CodeBuildProjectProps props)
      Parameters:
      project - This parameter is required.
      props -
    • CodeBuildProject

      @Stability(Stable) public CodeBuildProject(@NotNull IProject project)
      Parameters:
      project - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule, @Nullable String _id)
      Allows using build projects as event rule targets.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.
      _id -
    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule)
      Allows using build projects as event rule targets.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.