Class RuleProps.Builder

java.lang.Object
software.amazon.awscdk.services.events.RuleProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<RuleProps>
Enclosing interface:
RuleProps

@Stability(Stable) public static final class RuleProps.Builder extends Object implements software.amazon.jsii.Builder<RuleProps>
A builder for RuleProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • enabled

      @Stability(Stable) public RuleProps.Builder enabled(Boolean enabled)
      Sets the value of RuleProps.getEnabled()
      Parameters:
      enabled - Indicates whether the rule is enabled.
      Returns:
      this
    • eventBus

      @Stability(Stable) public RuleProps.Builder eventBus(IEventBus eventBus)
      Sets the value of RuleProps.getEventBus()
      Parameters:
      eventBus - The event bus to associate with this rule.
      Returns:
      this
    • schedule

      @Stability(Stable) public RuleProps.Builder schedule(Schedule schedule)
      Sets the value of RuleProps.getSchedule()
      Parameters:
      schedule - The schedule or rate (frequency) that determines when EventBridge runs the rule. You must specify this property, the eventPattern property, or both.

      For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.

      Returns:
      this
    • targets

      @Stability(Stable) public RuleProps.Builder targets(List<? extends IRuleTarget> targets)
      Sets the value of RuleProps.getTargets()
      Parameters:
      targets - Targets to invoke when this rule matches an event. Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]).
      Returns:
      this
    • crossStackScope

      @Stability(Stable) public RuleProps.Builder crossStackScope(software.constructs.Construct crossStackScope)
      Parameters:
      crossStackScope - The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). This helps dealing with cycles that often arise in these situations.
      Returns:
      this
    • description

      @Stability(Stable) public RuleProps.Builder description(String description)
      Parameters:
      description - A description of the rule's purpose.
      Returns:
      this
    • eventPattern

      @Stability(Stable) public RuleProps.Builder eventPattern(EventPattern eventPattern)
      Parameters:
      eventPattern - Additional restrictions for the event to route to the specified target. The method that generates the rule probably imposes some type of event filtering. The filtering implied by what you pass here is added on top of that filtering.
      Returns:
      this
    • ruleName

      @Stability(Stable) public RuleProps.Builder ruleName(String ruleName)
      Parameters:
      ruleName - A name for the rule.
      Returns:
      this
    • build

      @Stability(Stable) public RuleProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<RuleProps>
      Returns:
      a new instance of RuleProps
      Throws:
      NullPointerException - if any required attribute was not provided