Interface IRuleProps
Properties for defining an EventBridge Rule.
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.AWS.Events.dll
Syntax (csharp)
public interface IRuleProps
Syntax (vb)
Public Interface IRuleProps
Remarks
ExampleMetadata: infused
Examples
var connection = new Connection(this, "Connection", new ConnectionProps {
Authorization = Authorization.ApiKey("x-api-key", SecretValue.SecretsManager("ApiSecretName")),
Description = "Connection with API Key x-api-key"
});
var destination = new ApiDestination(this, "Destination", new ApiDestinationProps {
Connection = connection,
Endpoint = "https://example.com",
Description = "Calling example.com with API key x-api-key"
});
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Minutes(1)),
Targets = new [] { new ApiDestination(destination) }
});
Synopsis
Properties
Description | A description of the rule's purpose. |
Enabled | Indicates whether the rule is enabled. |
EventBus | The event bus to associate with this rule. |
EventPattern | Describes which events EventBridge routes to the specified target. |
RuleName | A name for the rule. |
Schedule | The schedule or rate (frequency) that determines when EventBridge runs the rule. |
Targets | Targets to invoke when this rule matches an event. |
Properties
Description
A description of the rule's purpose.
virtual string Description { get; }
Property Value
System.String
Remarks
Default: - No description.
Enabled
Indicates whether the rule is enabled.
virtual Nullable<bool> Enabled { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
EventBus
The event bus to associate with this rule.
virtual IEventBus EventBus { get; }
Property Value
Remarks
Default: - The default event bus.
EventPattern
Describes which events EventBridge routes to the specified target.
virtual IEventPattern EventPattern { get; }
Property Value
Remarks
These routed events are matched events. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
Default: - None.
See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html
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.
RuleName
A name for the rule.
virtual string RuleName { get; }
Property Value
System.String
Remarks
Default: - AWS CloudFormation generates a unique physical ID and uses that ID for the rule name. For more information, see Name Type.
Schedule
The schedule or rate (frequency) that determines when EventBridge runs the rule.
virtual Schedule Schedule { get; }
Property Value
Remarks
For more information, see Schedule Expression Syntax for Rules in the Amazon EventBridge User Guide.
Default: - None.
See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html
You must specify this property, the eventPattern
property, or both.
Targets
Targets to invoke when this rule matches an event.
virtual IRuleTarget[] Targets { get; }
Property Value
Remarks
Input will be the full matched event. If you wish to specify custom
target input, use addTarget(target[, inputOptions])
.
Default: - No targets.