Skip to main content

scheduled_actions

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

Overview

Namescheduled_actions
TypeResource
Idaws.redshift_serverless.scheduled_actions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
end_timestring (date-time)The end time of
namespace_namestringThe end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger. (pattern: <code>^[a-z0-9-]+$</code>)
next_invocationsarrayAn array of timestamps of when the next scheduled actions will trigger.
role_arnstringThe ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots. (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 Management Guide
scheduleobjectThe schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC. Format of at timestamp is yyyy-mm-ddThh:mm:ss. For example, 2016-03-04T17:27:00. Format of cron expression is (Minutes Hours Day-of-month Month Day-of-week Year). For example, "(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. (pattern: <code>^[a-z0-9-]+$</code>)
scheduled_action_uuidstringThe uuid of the scheduled action.
start_timestring (date-time)The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.
statestringThe state of the scheduled action. (ACTIVE, DISABLED)
target_actionobjectA JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action. "{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_scheduled_actionselectregionReturns information about a scheduled action.
list_scheduled_actionsselectregionReturns a list of scheduled actions. You can use the flags to filter the list of returned scheduled actions.
create_scheduled_actioninsertregion, namespaceName, roleArn, schedule, scheduledActionName, targetActionCreates 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 CreateSnapshot API operation.
update_scheduled_actionupdateregion, scheduledActionNameUpdates a scheduled action.
delete_scheduled_actiondeleteregionDeletes 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
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about a scheduled action.

SELECT
end_time,
namespace_name,
next_invocations,
role_arn,
schedule,
scheduled_action_description,
scheduled_action_name,
scheduled_action_uuid,
start_time,
state,
target_action
FROM aws.redshift_serverless.scheduled_actions
WHERE region = '{{ region }}' -- required
;

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 CreateSnapshot API operation.

INSERT INTO aws.redshift_serverless.scheduled_actions (
enabled,
endTime,
namespaceName,
roleArn,
schedule,
scheduledActionDescription,
scheduledActionName,
startTime,
targetAction,
region
)
SELECT
{{ enabled }},
'{{ endTime }}',
'{{ namespaceName }}' /* required */,
'{{ roleArn }}' /* required */,
'{{ schedule }}' /* required */,
'{{ scheduledActionDescription }}',
'{{ scheduledActionName }}' /* required */,
'{{ startTime }}',
'{{ targetAction }}' /* required */,
'{{ region }}'
RETURNING
scheduled_action
;

UPDATE examples

Updates a scheduled action.

UPDATE aws.redshift_serverless.scheduled_actions
SET
enabled = {{ enabled }},
endTime = '{{ endTime }}',
roleArn = '{{ roleArn }}',
schedule = '{{ schedule }}',
scheduledActionDescription = '{{ scheduledActionDescription }}',
scheduledActionName = '{{ scheduledActionName }}',
startTime = '{{ startTime }}',
targetAction = '{{ targetAction }}'
WHERE
region = '{{ region }}' --required
AND scheduledActionName = '{{ scheduledActionName }}' --required
RETURNING
scheduled_action;

DELETE examples

Deletes a scheduled action.

DELETE FROM aws.redshift_serverless.scheduled_actions
WHERE region = '{{ region }}' --required
;