@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:09.058Z") @Stability(value=Experimental) public interface RuleProps extends software.amazon.jsii.JsiiSerializable
Example:
import software.amazon.awscdk.core.*;
Function fn = Function.Builder.create(this, "MyFunc")
.runtime(Runtime.NODEJS_12_X)
.handler("index.handler")
.code(Code.fromInline("exports.handler = handler.toString()"))
.build();
Rule rule = Rule.Builder.create(this, "rule")
.eventPattern(EventPattern.builder()
.source(List.of("aws.ec2"))
.build())
.build();
Queue queue = new Queue(this, "Queue");
rule.addTarget(LambdaFunction.Builder.create(fn)
.deadLetterQueue(queue) // Optional: add a dead letter queue
.maxEventAge(Duration.hours(2)) // Optional: set the maxEventAge retry policy
.retryAttempts(2)
.build());
| Modifier and Type | Interface and Description |
|---|---|
static class |
RuleProps.Builder
A builder for
RuleProps |
static class |
RuleProps.Jsii$Proxy
An implementation for
RuleProps |
| Modifier and Type | Method and Description |
|---|---|
static RuleProps.Builder |
builder() |
default String |
getDescription()
(experimental) A description of the rule's purpose.
|
default Boolean |
getEnabled()
(experimental) Indicates whether the rule is enabled.
|
default IEventBus |
getEventBus()
(experimental) The event bus to associate with this rule.
|
default EventPattern |
getEventPattern()
(experimental) Describes which events EventBridge routes to the specified target.
|
default String |
getRuleName()
(experimental) A name for the rule.
|
default Schedule |
getSchedule()
(experimental) The schedule or rate (frequency) that determines when EventBridge runs the rule.
|
default List<IRuleTarget> |
getTargets()
(experimental) Targets to invoke when this rule matches an event.
|
@Stability(value=Experimental) @Nullable default String getDescription()
Default: - No description.
@Stability(value=Experimental) @Nullable default Boolean getEnabled()
Default: true
@Stability(value=Experimental) @Nullable default IEventBus getEventBus()
Default: - The default event bus.
@Stability(value=Experimental) @Nullable default EventPattern getEventPattern()
These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
Default: - None.
You must specify this property (either via props or via
`addEventPattern`), the `scheduleExpression` property, or both. The
method `addEventPattern` can be used to add filter values to the event
pattern.@Stability(value=Experimental) @Nullable default String getRuleName()
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.
@Stability(value=Experimental) @Nullable default Schedule getSchedule()
For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.
Default: - None.
You must specify this property, the `eventPattern` property, or both.@Stability(value=Experimental) @Nullable default List<IRuleTarget> getTargets()
Input will be the full matched event. If you wish to specify custom
target input, use addTarget(target[, inputOptions]).
Default: - No targets.
@Stability(value=Experimental) static RuleProps.Builder builder()
RuleProps.Builder of RulePropsCopyright © 2022. All rights reserved.