Class Rule.Builder

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

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

    • create

      @Stability(Stable) public static Rule.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Rule.Builder.
    • description

      @Stability(Stable) public Rule.Builder description(String description)
      A description of the rule's purpose.

      Default: - No description.

      Parameters:
      description - A description of the rule's purpose. This parameter is required.
      Returns:
      this
    • enabled

      @Stability(Stable) public Rule.Builder enabled(Boolean enabled)
      Indicates whether the rule is enabled.

      Default: true

      Parameters:
      enabled - Indicates whether the rule is enabled. This parameter is required.
      Returns:
      this
    • eventBus

      @Stability(Stable) public Rule.Builder eventBus(IEventBus eventBus)
      The event bus to associate with this rule.

      Default: - The default event bus.

      Parameters:
      eventBus - The event bus to associate with this rule. This parameter is required.
      Returns:
      this
    • eventPattern

      @Stability(Stable) public Rule.Builder eventPattern(EventPattern eventPattern)
      Describes which events EventBridge routes to the specified target.

      These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.

      Default: - None.

      Parameters:
      eventPattern - Describes which events EventBridge routes to the specified target. This parameter is required.
      Returns:
      this
      See Also:
    • ruleName

      @Stability(Stable) public Rule.Builder ruleName(String ruleName)
      A name for the rule.

      Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.

      Parameters:
      ruleName - A name for the rule. This parameter is required.
      Returns:
      this
    • schedule

      @Stability(Stable) public Rule.Builder schedule(Schedule schedule)
      The schedule or rate (frequency) that determines when EventBridge runs the rule.

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

      Default: - None.

      Parameters:
      schedule - The schedule or rate (frequency) that determines when EventBridge runs the rule. This parameter is required.
      Returns:
      this
      See Also:
    • targets

      @Stability(Stable) public Rule.Builder targets(List<? extends IRuleTarget> 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]).

      Default: - No targets.

      Parameters:
      targets - Targets to invoke when this rule matches an event. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Rule build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Rule>
      Returns:
      a newly built instance of Rule.