Skip to main content

schedules

Creates, updates, deletes, gets or lists a schedules resource.

Overview

Nameschedules
TypeResource
Idaws.scheduler.schedules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
action_after_completionstringIndicates the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target. (NONE, DELETE)
arnstringThe Amazon Resource Name (ARN) of the schedule. (pattern: <code>^arn:aws(-[a-z]+)?:scheduler:[a-z0-9-]+:\d{12}:schedule/[0-9a-zA-Z-.]+/[0-9a-zA-Z-.]+$</code>)
creation_datestring (date-time)The time at which the schedule was created.
descriptionstringThe description of the schedule.
end_datestring (date-time)The date, in UTC, before which the schedule can invoke its target. 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.
flexible_time_windowobjectAllows you to configure a time window during which EventBridge Scheduler invokes the schedule.
group_namestringThe name of the schedule group associated with this schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>)
kms_key_arnstringThe ARN for a customer managed KMS Key that is be used to encrypt and decrypt your data. (pattern: <code>^arn:aws(-[a-z]+)?:kms:[a-z0-9-]+:\d{12}:(key|alias)/[0-9a-zA-Z-_]*$</code>)
last_modification_datestring (date-time)The time at which the schedule was last modified.
namestringThe name of the schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>)
schedule_expressionstringThe expression that defines when the schedule runs. The following formats are supported. at expression - at(yyyy-mm-ddThh:mm:ss) rate expression - rate(value unit) cron expression - cron(fields) You can use at expressions to create one-time schedules that invoke a target once, at the time and in the time zone, that you specify. You can use rate and cron expressions to create recurring schedules. Rate-based schedules are useful when you want to invoke a target at regular intervals, such as every 15 minutes or every five days. Cron-based schedules are useful when you want to invoke a target periodically at a specific time, such as at 8:00 am (UTC+0) every 1st day of the month. A cron expression consists of six fields separated by white spaces: (minutes hours day_of_month month day_of_week year). A rate expression consists of a value as a positive integer, and a unit with the following options: minute | minutes | hour | hours | day | days For more information and examples, see Schedule types on EventBridge Scheduler in the EventBridge Scheduler User Guide.
schedule_expression_timezonestringThe timezone in which the scheduling expression is evaluated.
start_datestring (date-time)The date, in UTC, after which the schedule can begin invoking its target. 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.
statestringSpecifies whether the schedule is enabled or disabled. (ENABLED, DISABLED)
targetobjectThe schedule's target. EventBridge Scheduler supports templated target that invoke common API operations, as well as universal targets that you can customize to invoke over 6,000 API operations across more than 270 services. You can only specify one templated or universal target for a schedule.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_scheduleselectname, regiongroupNameRetrieves the specified schedule.
list_schedulesselectregionScheduleGroup, MaxResults, NamePrefix, NextToken, StateReturns a paginated list of your EventBridge Scheduler schedules.
create_scheduleinsertname, region, FlexibleTimeWindow, ScheduleExpressionCreates the specified schedule.
update_scheduleupdatename, region, FlexibleTimeWindow, ScheduleExpressionUpdates the specified schedule. When you call UpdateSchedule, EventBridge Scheduler uses all values, including empty values, specified in the request and overrides the existing schedule. This is by design. This means that if you do not set an optional field in your request, that field will be set to its system-default value after the update. Before calling this operation, we recommend that you call the GetSchedule API operation and make a note of all optional parameters for your UpdateSchedule call.
delete_scheduledeletename, regionclientToken, groupNameDeletes the specified schedule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
namestringThe name of the schedule to delete.
regionstringAWS region (default: us-east-1)
MaxResultsintegerIf specified, limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
NamePrefixstringSchedule name prefix to return the filtered list of resources.
NextTokenstringThe token returned by a previous call to retrieve the next set of results.
ScheduleGroupstringIf specified, only lists the schedules whose associated schedule group matches the given filter.
StatestringIf specified, only lists the schedules whose current state matches the given filter.
clientTokenstringUnique, case-sensitive identifier you provide to ensure the idempotency of the request. If you do not specify a client token, EventBridge Scheduler uses a randomly generated token for the request to ensure idempotency.
groupNamestringThe name of the schedule group associated with this schedule. If you omit this, the default schedule group is used.

SELECT examples

Retrieves the specified schedule.

SELECT
action_after_completion,
arn,
creation_date,
description,
end_date,
flexible_time_window,
group_name,
kms_key_arn,
last_modification_date,
name,
schedule_expression,
schedule_expression_timezone,
start_date,
state,
target
FROM aws.scheduler.schedules
WHERE name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
AND groupName = '{{ groupName }}'
;

INSERT examples

Creates the specified schedule.

INSERT INTO aws.scheduler.schedules (
ActionAfterCompletion,
ClientToken,
Description,
EndDate,
FlexibleTimeWindow,
GroupName,
KmsKeyArn,
ScheduleExpression,
ScheduleExpressionTimezone,
StartDate,
State,
Target,
name,
region
)
SELECT
'{{ ActionAfterCompletion }}',
'{{ ClientToken }}',
'{{ Description }}',
'{{ EndDate }}',
'{{ FlexibleTimeWindow }}' /* required */,
'{{ GroupName }}',
'{{ KmsKeyArn }}',
'{{ ScheduleExpression }}' /* required */,
'{{ ScheduleExpressionTimezone }}',
'{{ StartDate }}',
'{{ State }}',
'{{ Target }}',
'{{ name }}',
'{{ region }}'
RETURNING
schedule_arn
;

UPDATE examples

Updates the specified schedule. When you call UpdateSchedule, EventBridge Scheduler uses all values, including empty values, specified in the request and overrides the existing schedule. This is by design. This means that if you do not set an optional field in your request, that field will be set to its system-default value after the update. Before calling this operation, we recommend that you call the GetSchedule API operation and make a note of all optional parameters for your UpdateSchedule call.

UPDATE aws.scheduler.schedules
SET
ActionAfterCompletion = '{{ ActionAfterCompletion }}',
ClientToken = '{{ ClientToken }}',
Description = '{{ Description }}',
EndDate = '{{ EndDate }}',
FlexibleTimeWindow = '{{ FlexibleTimeWindow }}',
GroupName = '{{ GroupName }}',
KmsKeyArn = '{{ KmsKeyArn }}',
ScheduleExpression = '{{ ScheduleExpression }}',
ScheduleExpressionTimezone = '{{ ScheduleExpressionTimezone }}',
StartDate = '{{ StartDate }}',
State = '{{ State }}',
Target = '{{ Target }}'
WHERE
name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND FlexibleTimeWindow = '{{ FlexibleTimeWindow }}' --required
AND ScheduleExpression = '{{ ScheduleExpression }}' --required
RETURNING
schedule_arn;

DELETE examples

Deletes the specified schedule.

DELETE FROM aws.scheduler.schedules
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
AND groupName = '{{ groupName }}'
;