Skip to main content

schedules

Creates, updates, deletes or gets a schedule resource or lists schedules in a region

Overview

Nameschedules
TypeResource
DescriptionDefinition of AWS::Scheduler::Schedule Resource Type
Idawscc.scheduler.schedules

Fields

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the schedule.
descriptionstringThe description of the schedule.
end_datestringThe 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_windowobjectFlexible time window allows configuration of a window within which a schedule can be invoked
group_namestringThe name of the schedule group to associate with this schedule. If you omit this, the default schedule group is used.
kms_key_arnstringThe ARN for a KMS Key that will be used to encrypt customer data.
namestring
schedule_expressionstringThe scheduling expression.
schedule_expression_timezonestringThe timezone in which the scheduling expression is evaluated.
start_datestringThe 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.
statestringSpecifies whether the schedule is enabled or disabled.
targetobjectThe schedule target.
regionstringAWS region.

For more information, see AWS::Scheduler::Schedule.

Methods

NameResourceAccessible byRequired Params
create_resourceschedulesINSERTFlexibleTimeWindow, ScheduleExpression, Target, region
delete_resourceschedulesDELETEIdentifier, region
update_resourceschedulesUPDATEIdentifier, PatchDocument, region
list_resourcesschedules_list_onlySELECTregion
get_resourceschedulesSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

Use the following StackQL query and manifest file to create a new schedule resource, using stack-deploy.

/*+ 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
;

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:

ParameterDescription
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:

scheduler:CreateSchedule,
scheduler:GetSchedule,
iam:PassRole