Class Schedule
Schedule for scheduled event rules.
Inheritance
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.ECS;
ICluster cluster;
TaskDefinition taskDefinition;
var rule = new Rule(this, "Rule", new RuleProps {
Schedule = Schedule.Rate(Duration.Hours(1))
});
rule.AddTarget(new EcsTask(new EcsTaskProps {
Cluster = cluster,
TaskDefinition = taskDefinition,
TaskCount = 1,
ContainerOverrides = new [] { new ContainerOverride {
ContainerName = "TheContainer",
Command = new [] { "echo", EventField.FromPath("$.detail.event") }
} },
EnableExecuteCommand = true
}));
Synopsis
Constructors
Schedule() | |
Schedule(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Schedule(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
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()
protected Schedule()
Schedule(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Schedule(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Schedule(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Schedule(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
ExpressionString
Retrieve the expression for this schedule.
public abstract string ExpressionString { get; }
Property Value
System.String
Methods
Cron(ICronOptions)
Create a schedule from a set of cron fields.
public static Schedule Cron(ICronOptions options)
Parameters
- options ICronOptions
Returns
Expression(String)
Construct a schedule from a literal schedule expression.
public static Schedule Expression(string expression)
Parameters
- expression System.String
The expression to use.
Returns