Show / Hide Table of Contents

Interface IRuleProps

Properties for defining an EventBridge Rule.

Inherited Members
IEventCommonOptions.CrossStackScope
IEventCommonOptions.Description
IEventCommonOptions.EventPattern
IEventCommonOptions.RuleName
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRuleProps : IEventCommonOptions
Syntax (vb)
Public Interface IRuleProps Inherits IEventCommonOptions
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.RedshiftServerless;

            CfnWorkgroup workgroup;


            var rule = new Rule(this, "Rule", new RuleProps {
                Schedule = Schedule.Rate(Duration.Hours(1))
            });

            var dlq = new Queue(this, "DeadLetterQueue");

            rule.AddTarget(new RedshiftQuery(workgroup.AttrWorkgroupWorkgroupArn, new RedshiftQueryProps {
                Database = "dev",
                DeadLetterQueue = dlq,
                Sql = new [] { "SELECT * FROM foo", "SELECT * FROM baz" }
            }));

Synopsis

Properties

Enabled

Indicates whether the rule is enabled.

EventBus

The event bus to associate with this rule.

Role

The role that is used for target invocation.

Schedule

The schedule or rate (frequency) that determines when EventBridge runs the rule.

Targets

Targets to invoke when this rule matches an event.

Properties

Enabled

Indicates whether the rule is enabled.

bool? Enabled { get; }
Property Value

bool?

Remarks

Default: true

EventBus

The event bus to associate with this rule.

IEventBusRef? EventBus { get; }
Property Value

IEventBusRef

Remarks

Default: - The default event bus.

Role

The role that is used for target invocation.

IRoleRef? Role { get; }
Property Value

IRoleRef

Remarks

Must be assumable by principal events.amazonaws.com.

Default: - No role associated

Schedule

The schedule or rate (frequency) that determines when EventBridge runs the rule.

Schedule? Schedule { get; }
Property Value

Schedule

Remarks

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.

Default: - None.

See: https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html

Targets

Targets to invoke when this rule matches an event.

IRuleTarget[]? Targets { get; }
Property Value

IRuleTarget[]

Remarks

Input will be the full matched event. If you wish to specify custom target input, use addTarget(target[, inputOptions]).

Default: - No targets.

Back to top Generated by DocFX