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.103.1 (build bef2dea)", date="2024-10-04T00:39:32.635Z") @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 "main" branch of the repo
 repo.onCommit("CommitToMain", OnCommitOptions.builder()
         .target(new CodeBuildProject(project))
         .branches(List.of("main"))
         .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.