schedules
Creates, updates, deletes or gets a schedule resource or lists schedules in a region
Overview
| Name | schedules |
| Type | Resource |
| Description | Definition of AWS::Scheduler::Schedule Resource Type |
| Id | awscc.scheduler.schedules |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the schedule. |
description | string | The description of the schedule. |
end_date | string | 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. |
flexible_time_window | object | Flexible time window allows configuration of a window within which a schedule can be invoked |
group_name | string | The name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used. |
kms_key_arn | string | The ARN for a KMS Key that will be used to encrypt customer data. |
name | string | |
schedule_expression | string | The scheduling expression. |
schedule_expression_timezone | string | The timezone in which the scheduling expression is evaluated. |
start_date | string | 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. |
state | string | Specifies whether the schedule is enabled or disabled. |
target | object | The schedule target. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
name | string | |
region | string | AWS region. |
For more information, see AWS::Scheduler::Schedule.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | schedules | INSERT | FlexibleTimeWindow, ScheduleExpression, Target, region |
delete_resource | schedules | DELETE | Identifier, region |
update_resource | schedules | UPDATE | Identifier, PatchDocument, region |
list_resources | schedules_list_only | SELECT | region |
get_resource | schedules | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual schedule.
SELECT
region,
arn,
description,
end_date,
flexible_time_window,
group_name,
kms_key_arn,
name,
schedule_expression,
schedule_expression_timezone,
start_date,
state,
target
FROM awscc.scheduler.schedules
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}';
Lists all schedules in a region.
SELECT
region,
name
FROM awscc.scheduler.schedules_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new schedule resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.scheduler.schedules (
FlexibleTimeWindow,
ScheduleExpression,
Target,
region
)
SELECT
'{{ flexible_time_window }}',
'{{ schedule_expression }}',
'{{ target }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.scheduler.schedules (
Description,
EndDate,
FlexibleTimeWindow,
GroupName,
KmsKeyArn,
Name,
ScheduleExpression,
ScheduleExpressionTimezone,
StartDate,
State,
Target,
region
)
SELECT
'{{ description }}',
'{{ end_date }}',
'{{ flexible_time_window }}',
'{{ group_name }}',
'{{ kms_key_arn }}',
'{{ name }}',
'{{ schedule_expression }}',
'{{ schedule_expression_timezone }}',
'{{ start_date }}',
'{{ state }}',
'{{ target }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: schedule
props:
- name: description
value: '{{ description }}'
- name: end_date
value: '{{ end_date }}'
- name: flexible_time_window
value:
mode: '{{ mode }}'
maximum_window_in_minutes: null
- name: group_name
value: '{{ group_name }}'
- name: kms_key_arn
value: '{{ kms_key_arn }}'
- name: name
value: '{{ name }}'
- name: schedule_expression
value: '{{ schedule_expression }}'
- name: schedule_expression_timezone
value: '{{ schedule_expression_timezone }}'
- name: start_date
value: '{{ start_date }}'
- name: state
value: '{{ state }}'
- name: target
value:
arn: '{{ arn }}'
role_arn: '{{ role_arn }}'
dead_letter_config:
arn: '{{ arn }}'
retry_policy:
maximum_event_age_in_seconds: null
maximum_retry_attempts: null
input: '{{ input }}'
ecs_parameters:
task_definition_arn: '{{ task_definition_arn }}'
task_count: null
launch_type: '{{ launch_type }}'
network_configuration:
awsvpc_configuration:
subnets:
- '{{ subnets[0] }}'
security_groups:
- '{{ security_groups[0] }}'
assign_public_ip: '{{ assign_public_ip }}'
platform_version: '{{ platform_version }}'
group: '{{ group }}'
capacity_provider_strategy:
- capacity_provider: '{{ capacity_provider }}'
weight: null
base: null
enable_ecs_managed_tags: '{{ enable_ecs_managed_tags }}'
enable_execute_command: '{{ enable_execute_command }}'
placement_constraints:
- type: '{{ type }}'
expression: '{{ expression }}'
placement_strategy:
- type: '{{ type }}'
field: '{{ field }}'
propagate_tags: '{{ propagate_tags }}'
reference_id: '{{ reference_id }}'
tags:
- {}
event_bridge_parameters:
detail_type: '{{ detail_type }}'
source: '{{ source }}'
kinesis_parameters:
partition_key: '{{ partition_key }}'
sage_maker_pipeline_parameters:
pipeline_parameter_list:
- name: '{{ name }}'
value: '{{ value }}'
sqs_parameters:
message_group_id: '{{ message_group_id }}'
UPDATE example
Use the following StackQL query and manifest file to update a schedule resource, using stack-deploy.
/*+ update */
UPDATE awscc.scheduler.schedules
SET PatchDocument = string('{{ {
"Description": description,
"EndDate": end_date,
"FlexibleTimeWindow": flexible_time_window,
"GroupName": group_name,
"KmsKeyArn": kms_key_arn,
"ScheduleExpression": schedule_expression,
"ScheduleExpressionTimezone": schedule_expression_timezone,
"StartDate": start_date,
"State": state,
"Target": target
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.scheduler.schedules
WHERE
Identifier = '{{ name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the schedules resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
scheduler:CreateSchedule,
scheduler:GetSchedule,
iam:PassRole
scheduler:GetSchedule
scheduler:UpdateSchedule,
scheduler:GetSchedule,
iam:PassRole
scheduler:DeleteSchedule,
scheduler:GetSchedule
scheduler:ListSchedules