Interface IEventBridgeSchedulerCreateScheduleTaskProps
Properties for creating an AWS EventBridge Scheduler schedule.
Inherited Members
Namespace: Amazon.CDK.AWS.StepFunctions.Tasks
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IEventBridgeSchedulerCreateScheduleTaskProps : ITaskStateBaseProps, IStateBaseProps, ITaskStateBaseOptions, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Syntax (vb)
Public Interface IEventBridgeSchedulerCreateScheduleTaskProps Inherits ITaskStateBaseProps, IStateBaseProps, ITaskStateBaseOptions, IAssignableStateOptions, IJsonPathCommonOptions, IJsonataCommonOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Scheduler;
using Amazon.CDK.AWS.KMS;
Key key;
CfnScheduleGroup scheduleGroup;
Queue targetQueue;
Queue deadLetterQueue;
var schedulerRole = new Role(this, "SchedulerRole", new RoleProps {
AssumedBy = new ServicePrincipal("scheduler.amazonaws.com")
});
// To send the message to the queue
// This policy changes depending on the type of target.
schedulerRole.AddToPrincipalPolicy(new PolicyStatement(new PolicyStatementProps {
Actions = new [] { "sqs:SendMessage" },
Resources = new [] { targetQueue.QueueArn }
}));
var createScheduleTask1 = new EventBridgeSchedulerCreateScheduleTask(this, "createSchedule", new EventBridgeSchedulerCreateScheduleTaskProps {
ScheduleName = "TestSchedule",
ActionAfterCompletion = ActionAfterCompletion.NONE,
ClientToken = "testToken",
Description = "TestDescription",
StartDate = new Date(),
EndDate = new Date(new Date().GetTime() + 1000 * 60 * 60),
FlexibleTimeWindow = Duration.Minutes(5),
GroupName = scheduleGroup.Ref,
KmsKey = key,
Schedule = Schedule.Rate(Duration.Minutes(5)),
Timezone = "UTC",
Enabled = true,
Target = new EventBridgeSchedulerTarget(new EventBridgeSchedulerTargetProps {
Arn = targetQueue.QueueArn,
Role = schedulerRole,
RetryPolicy = new RetryPolicy {
MaximumRetryAttempts = 2,
MaximumEventAge = Duration.Minutes(5)
},
DeadLetterQueue = deadLetterQueue
})
});
Synopsis
Properties
| ActionAfterCompletion | Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target. |
| ClientToken | Unique, case-sensitive identifier to ensure the idempotency of the request. |
| Description | The description for the schedule. |
| Enabled | Specifies whether the schedule is enabled or disabled. |
| EndDate | The date, in UTC, before which the schedule can invoke its target. |
| FlexibleTimeWindow | The maximum time window during which a schedule can be invoked. |
| GroupName | The name of the schedule group to associate with this schedule. |
| KmsKey | The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt payload. |
| Schedule | The schedule that defines when the schedule will trigger. |
| ScheduleName | Schedule name. |
| StartDate | The date, in UTC, after which the schedule can begin invoking its target. |
| Target | The schedule's target. |
| Timezone | The timezone in which the scheduling expression is evaluated. |
Properties
ActionAfterCompletion
Specifies the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target.
ActionAfterCompletion? ActionAfterCompletion { get; }
Property Value
Remarks
Default: ActionAfterCompletion.NONE
ClientToken
Unique, case-sensitive identifier to ensure the idempotency of the request.
string? ClientToken { get; }
Property Value
Remarks
Default: - Automatically generated
Description
The description for the schedule.
string? Description { get; }
Property Value
Remarks
Default: - No description
Enabled
Specifies whether the schedule is enabled or disabled.
bool? Enabled { get; }
Property Value
bool?
Remarks
Default: true
EndDate
The date, in UTC, before which the schedule can invoke its target.
DateTime? EndDate { get; }
Property Value
Remarks
Depending on the schedule's recurrence expression, invocations might stop on, or before, the EndDate you specify. EventBridge Scheduler ignores EndDate for one-time schedules.
Default: - No end date
FlexibleTimeWindow
The maximum time window during which a schedule can be invoked.
Duration? FlexibleTimeWindow { get; }
Property Value
Remarks
Minimum value is 1 minute. Maximum value is 1440 minutes (1 day).
Default: - Flexible time window is not enabled.
GroupName
The name of the schedule group to associate with this schedule.
string? GroupName { get; }
Property Value
Remarks
Default: - The default schedule group is used.
KmsKey
The customer managed KMS key that EventBridge Scheduler will use to encrypt and decrypt payload.
IKey? KmsKey { get; }
Property Value
Remarks
Default: - Use automatically generated KMS key
See: https://docs.aws.amazon.com/scheduler/latest/UserGuide/encryption-rest.html
Schedule
The schedule that defines when the schedule will trigger.
Schedule Schedule { get; }
Property Value
Remarks
ScheduleName
StartDate
The date, in UTC, after which the schedule can begin invoking its target.
DateTime? StartDate { get; }
Property Value
Remarks
Depending on the schedule's recurrence expression, invocations might occur on, or after, the StartDate you specify. EventBridge Scheduler ignores StartDate for one-time schedules.
Default: - No start date
Target
The schedule's target.
EventBridgeSchedulerTarget Target { get; }
Property Value
Remarks
ExampleMetadata: infused
Timezone
The timezone in which the scheduling expression is evaluated.
string? Timezone { get; }
Property Value
Remarks
Default: - UTC