schedules
Creates, updates, deletes, gets or lists a schedules resource.
Overview
| Name | schedules |
| Type | Resource |
| Id | aws.scheduler.schedules |
Fields
The following fields are returned by SELECT queries:
- get_schedule
- list_schedules
| Name | Datatype | Description |
|---|---|---|
action_after_completion | string | Indicates the action that EventBridge Scheduler applies to the schedule after the schedule completes invoking the target. (NONE, DELETE) |
arn | string | The 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_date | string (date-time) | The time at which the schedule was created. |
description | string | The description of the schedule. |
end_date | string (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_window | object | Allows you to configure a time window during which EventBridge Scheduler invokes the schedule. |
group_name | string | The name of the schedule group associated with this schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>) |
kms_key_arn | string | The 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_date | string (date-time) | The time at which the schedule was last modified. |
name | string | The name of the schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>) |
schedule_expression | string | The 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_timezone | string | The timezone in which the scheduling expression is evaluated. |
start_date | string (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. |
state | string | Specifies whether the schedule is enabled or disabled. (ENABLED, DISABLED) |
target | object | The 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. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The 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_date | string (date-time) | The time at which the schedule was created. |
group_name | string | The name of the schedule group associated with this schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>) |
last_modification_date | string (date-time) | The time at which the schedule was last modified. |
name | string | The name of the schedule. (pattern: <code>^[0-9a-zA-Z-_.]+$</code>) |
state | string | Specifies whether the schedule is enabled or disabled. (ENABLED, DISABLED) |
target | object | The schedule's target details. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_schedule | select | name, region | groupName | Retrieves the specified schedule. |
list_schedules | select | region | ScheduleGroup, MaxResults, NamePrefix, NextToken, State | Returns a paginated list of your EventBridge Scheduler schedules. |
create_schedule | insert | name, region, FlexibleTimeWindow, ScheduleExpression | Creates the specified schedule. | |
update_schedule | update | name, region, FlexibleTimeWindow, ScheduleExpression | 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. | |
delete_schedule | delete | name, region | clientToken, groupName | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the schedule to delete. |
region | string | AWS region (default: us-east-1) |
MaxResults | integer | If 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. |
NamePrefix | string | Schedule name prefix to return the filtered list of resources. |
NextToken | string | The token returned by a previous call to retrieve the next set of results. |
ScheduleGroup | string | If specified, only lists the schedules whose associated schedule group matches the given filter. |
State | string | If specified, only lists the schedules whose current state matches the given filter. |
clientToken | string | Unique, 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. |
groupName | string | The name of the schedule group associated with this schedule. If you omit this, the default schedule group is used. |
SELECT examples
- get_schedule
- list_schedules
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 }}'
;
Returns a paginated list of your EventBridge Scheduler schedules.
SELECT
arn,
creation_date,
group_name,
last_modification_date,
name,
state,
target
FROM aws.scheduler.schedules
WHERE region = '{{ region }}' -- required
AND ScheduleGroup = '{{ ScheduleGroup }}'
AND MaxResults = '{{ MaxResults }}'
AND NamePrefix = '{{ NamePrefix }}'
AND NextToken = '{{ NextToken }}'
AND State = '{{ State }}'
;
INSERT examples
- create_schedule
- Manifest
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
;
# Description fields are for documentation purposes
- name: schedules
props:
- name: name
value: "{{ name }}"
description: Required parameter for the schedules resource.
- name: region
value: "{{ region }}"
description: Required parameter for the schedules resource.
- name: ActionAfterCompletion
value: "{{ ActionAfterCompletion }}"
valid_values: ['NONE', 'DELETE']
- name: ClientToken
value: "{{ ClientToken }}"
- name: Description
value: "{{ Description }}"
- name: EndDate
value: "{{ EndDate }}"
- name: FlexibleTimeWindow
description: |
Allows you to configure a time window during which EventBridge Scheduler invokes the schedule.
value:
MaximumWindowInMinutes: {{ MaximumWindowInMinutes }}
Mode: "{{ Mode }}"
- name: GroupName
value: "{{ GroupName }}"
- name: KmsKeyArn
value: "{{ KmsKeyArn }}"
- name: ScheduleExpression
value: "{{ ScheduleExpression }}"
- name: ScheduleExpressionTimezone
value: "{{ ScheduleExpressionTimezone }}"
- name: StartDate
value: "{{ StartDate }}"
- name: State
value: "{{ State }}"
valid_values: ['ENABLED', 'DISABLED']
- name: Target
description: |
The 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.
value:
Arn: "{{ Arn }}"
DeadLetterConfig:
Arn: "{{ Arn }}"
EcsParameters:
CapacityProviderStrategy:
- base: {{ base }}
capacityProvider: "{{ capacityProvider }}"
weight: {{ weight }}
EnableECSManagedTags: {{ EnableECSManagedTags }}
EnableExecuteCommand: {{ EnableExecuteCommand }}
Group: "{{ Group }}"
LaunchType: "{{ LaunchType }}"
NetworkConfiguration:
awsvpcConfiguration:
AssignPublicIp: "{{ AssignPublicIp }}"
SecurityGroups:
- "{{ SecurityGroups }}"
Subnets:
- "{{ Subnets }}"
PlacementConstraints:
- expression: "{{ expression }}"
type_: "{{ type_ }}"
PlacementStrategy:
- field: "{{ field }}"
type_: "{{ type_ }}"
PlatformVersion: "{{ PlatformVersion }}"
PropagateTags: "{{ PropagateTags }}"
ReferenceId: "{{ ReferenceId }}"
Tags: "{{ Tags }}"
TaskCount: {{ TaskCount }}
TaskDefinitionArn: "{{ TaskDefinitionArn }}"
EventBridgeParameters:
DetailType: "{{ DetailType }}"
Source: "{{ Source }}"
Input: "{{ Input }}"
KinesisParameters:
PartitionKey: "{{ PartitionKey }}"
RetryPolicy:
MaximumEventAgeInSeconds: {{ MaximumEventAgeInSeconds }}
MaximumRetryAttempts: {{ MaximumRetryAttempts }}
RoleArn: "{{ RoleArn }}"
SageMakerPipelineParameters:
PipelineParameterList:
- Name: "{{ Name }}"
Value: "{{ Value }}"
SqsParameters:
MessageGroupId: "{{ MessageGroupId }}"
UPDATE examples
- update_schedule
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
- delete_schedule
Deletes the specified schedule.
DELETE FROM aws.scheduler.schedules
WHERE name = '{{ name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}'
AND groupName = '{{ groupName }}'
;