Skip to main content

scheduled_actions

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

Overview

Namescheduled_actions
TypeResource
Idaws.redshift.scheduled_actions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
end_timestringThe end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.
iam_rolestringThe IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see Using Identity-Based Policies for Amazon Redshift in the Amazon Redshift Cluster Management Guide.
next_invocationsstringList of times when the scheduled action will run.
schedulestringThe schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Format of at expressions is "at(yyyy-mm-ddThh:mm:ss)". For example, "at(2016-03-04T17:27:00)". Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week Year)". For example, "cron(0 10 ? * MON *)". For more information, see Cron Expressions in the Amazon CloudWatch Events User Guide.
scheduled_action_descriptionstringThe description of the scheduled action.
scheduled_action_namestringThe name of the scheduled action.
start_timestringThe start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
statestringThe state of the scheduled action. For example, DISABLED.
target_actionstringA JSON format string of the Amazon Redshift API operation with input parameters. "{"ResizeCluster":{"NodeType":"ra3.4xlarge","ClusterIdentifier":"my-test-cluster","NumberOfNodes":3}}".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_scheduled_actionsselectregionScheduledActionName, TargetActionType, StartTime, EndTime, Active, Filters, Marker, MaxRecordsDescribes properties of scheduled actions.
create_scheduled_actioninsertScheduledActionName, TargetAction, IamRole, regionSchedule, ScheduledActionDescription, StartTime, EndTime, EnableCreates a scheduled action. A scheduled action contains a schedule and an Amazon Redshift API action. For example, you can create a schedule of when to run the ResizeCluster API operation.
modify_scheduled_actionupdateScheduledActionName, regionTargetAction, Schedule, IamRole, ScheduledActionDescription, StartTime, EndTime, EnableModifies a scheduled action.
delete_scheduled_actiondeleteScheduledActionName, regionDeletes a scheduled action.

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
IamRolestringThe IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction.
ScheduledActionNamestringThe name of the scheduled action to delete.
TargetActionobjectA JSON format string of the Amazon Redshift API operation with input parameters. For more information about this parameter, see ScheduledAction.
regionstringAWS region (default: us-east-1)
ActivebooleanIf true, retrieve only active scheduled actions. If false, retrieve only disabled scheduled actions.
EnablebooleanA modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled.
EndTimestring (date-time)A modified end time of the scheduled action. For more information about this parameter, see ScheduledAction.
FiltersarrayList of scheduled action filters.
IamRolestringA different IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction.
MarkerstringAn optional parameter that specifies the starting point to return a set of response records. When the results of a DescribeScheduledActions request exceed the value specified in MaxRecords, Amazon Web Services returns a value in the Marker field of the response. You can retrieve the next set of response records by providing the returned marker value in the Marker parameter and retrying the request.
MaxRecordsintegerThe maximum number of response records to return in each call. If the number of remaining response records exceeds the specified MaxRecords value, a value is returned in a marker field of the response. You can retrieve the next set of records by retrying the command with the returned marker value. Default: 100 Constraints: minimum 20, maximum 100.
SchedulestringA modified schedule in either at( ) or cron( ) format. For more information about this parameter, see ScheduledAction.
ScheduledActionDescriptionstringA modified description of the scheduled action.
ScheduledActionNamestringThe name of the scheduled action to retrieve.
StartTimestring (date-time)A modified start time of the scheduled action. For more information about this parameter, see ScheduledAction.
TargetActionobjectA modified JSON format of the scheduled action. For more information about this parameter, see ScheduledAction.
TargetActionTypestringThe type of the scheduled actions to retrieve.

SELECT examples

Describes properties of scheduled actions.

SELECT
end_time,
iam_role,
next_invocations,
schedule,
scheduled_action_description,
scheduled_action_name,
start_time,
state,
target_action
FROM aws.redshift.scheduled_actions
WHERE region = '{{ region }}' -- required
AND ScheduledActionName = '{{ ScheduledActionName }}'
AND TargetActionType = '{{ TargetActionType }}'
AND StartTime = '{{ StartTime }}'
AND EndTime = '{{ EndTime }}'
AND Active = '{{ Active }}'
AND Filters = '{{ Filters }}'
AND Marker = '{{ Marker }}'
AND MaxRecords = '{{ MaxRecords }}'
;

INSERT examples

Creates a scheduled action. A scheduled action contains a schedule and an Amazon Redshift API action. For example, you can create a schedule of when to run the ResizeCluster API operation.

INSERT INTO aws.redshift.scheduled_actions (
ScheduledActionName,
TargetAction,
IamRole,
region,
Schedule,
ScheduledActionDescription,
StartTime,
EndTime,
Enable
)
SELECT
'{{ ScheduledActionName }}',
'{{ TargetAction }}',
'{{ IamRole }}',
'{{ region }}',
'{{ Schedule }}',
'{{ ScheduledActionDescription }}',
'{{ StartTime }}',
'{{ EndTime }}',
'{{ Enable }}'
RETURNING
end_time,
iam_role,
next_invocations,
schedule,
scheduled_action_description,
scheduled_action_name,
start_time,
state,
target_action
;

UPDATE examples

Modifies a scheduled action.

UPDATE aws.redshift.scheduled_actions
SET
-- No updatable properties
WHERE
ScheduledActionName = '{{ ScheduledActionName }}' --required
AND region = '{{ region }}' --required
AND TargetAction = '{{ TargetAction}}'
AND Schedule = '{{ Schedule}}'
AND IamRole = '{{ IamRole}}'
AND ScheduledActionDescription = '{{ ScheduledActionDescription}}'
AND StartTime = '{{ StartTime}}'
AND EndTime = '{{ EndTime}}'
AND Enable = {{ Enable}}
RETURNING
end_time,
iam_role,
next_invocations,
schedule,
scheduled_action_description,
scheduled_action_name,
start_time,
state,
target_action;

DELETE examples

Deletes a scheduled action.

DELETE FROM aws.redshift.scheduled_actions
WHERE ScheduledActionName = '{{ ScheduledActionName }}' --required
AND region = '{{ region }}' --required
;