Show / Hide Table of Contents

Class Schedule

Schedule for scheduled event rules.

Inheritance
object
Schedule
Namespace: Amazon.CDK.AWS.Events
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class Schedule : DeputyBase
Syntax (vb)
Public MustInherit Class Schedule Inherits DeputyBase
Remarks

Note that rates cannot be defined in fractions of minutes.

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

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

Constructors

Schedule()

Schedule for scheduled event rules.

Properties

ExpressionString

Retrieve the expression for this schedule.

Methods

Cron(ICronOptions)

Create a schedule from a set of cron fields.

Expression(string)

Construct a schedule from a literal schedule expression.

Rate(Duration)

Construct a schedule from an interval and a time unit.

Constructors

Schedule()

Schedule for scheduled event rules.

protected Schedule()
Remarks

Note that rates cannot be defined in fractions of minutes.

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

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" }
             }));

Properties

ExpressionString

Retrieve the expression for this schedule.

public abstract string ExpressionString { get; }
Property Value

string

Remarks

Note that rates cannot be defined in fractions of minutes.

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

ExampleMetadata: infused

Methods

Cron(ICronOptions)

Create a schedule from a set of cron fields.

public static Schedule Cron(ICronOptions options)
Parameters
options ICronOptions
Returns

Schedule

Remarks

Note that rates cannot be defined in fractions of minutes.

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

ExampleMetadata: infused

Expression(string)

Construct a schedule from a literal schedule expression.

public static Schedule Expression(string expression)
Parameters
expression string

The expression to use.

Returns

Schedule

Remarks

Note that rates cannot be defined in fractions of minutes.

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

ExampleMetadata: infused

Rate(Duration)

Construct a schedule from an interval and a time unit.

public static Schedule Rate(Duration duration)
Parameters
duration Duration
Returns

Schedule

Remarks

Rates may be defined with any unit of time, but when converted into minutes, the duration must be a positive whole number of minutes.

Back to top Generated by DocFX