Skip to main content

scheduled_actions

Creates, updates, deletes or gets a scheduled_action resource or lists scheduled_actions in a region

Overview

Namescheduled_actions
TypeResource
DescriptionThe AWS::Redshift::ScheduledAction resource creates an Amazon Redshift Scheduled Action.
Idawscc.redshift.scheduled_actions

Fields

NameDatatypeDescription
scheduled_action_descriptionstringThe description of the scheduled action.
scheduled_action_namestringThe name of the scheduled action. The name must be unique within an account.
end_timestringThe end time in UTC of the scheduled action. After this time, the scheduled action does not trigger.
statestringThe state of the scheduled action.
schedulestringThe schedule in at( ) or cron( ) format.
iam_rolestringThe IAM role to assume to run the target action.
enablebooleanIf true, the schedule is enabled. If false, the scheduled action does not trigger.
target_actionobjectA JSON format string of the Amazon Redshift API operation with input parameters.
next_invocationsarrayList of times when the scheduled action will run.
regionstringAWS region.

For more information, see AWS::Redshift::ScheduledAction.

Methods

NameResourceAccessible byRequired Params
create_resourcescheduled_actionsINSERTScheduledActionName, region
delete_resourcescheduled_actionsDELETEIdentifier, region
update_resourcescheduled_actionsUPDATEIdentifier, PatchDocument, region
list_resourcesscheduled_actions_list_onlySELECTregion
get_resourcescheduled_actionsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual scheduled_action.

SELECT
region,
scheduled_action_description,
scheduled_action_name,
end_time,
state,
schedule,
iam_role,
start_time,
enable,
target_action,
next_invocations
FROM awscc.redshift.scheduled_actions
WHERE
region = '{{ region }}' AND
Identifier = '{{ scheduled_action_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.redshift.scheduled_actions (
ScheduledActionName,
region
)
SELECT
'{{ scheduled_action_name }}',
'{{ 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 scheduled_action resource, using stack-deploy.

/*+ update */
UPDATE awscc.redshift.scheduled_actions
SET PatchDocument = string('{{ {
"ScheduledActionDescription": scheduled_action_description,
"EndTime": end_time,
"Schedule": schedule,
"IamRole": iam_role,
"StartTime": start_time,
"Enable": enable,
"TargetAction": target_action
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ scheduled_action_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.redshift.scheduled_actions
WHERE
Identifier = '{{ scheduled_action_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 scheduled_actions resource, the following permissions are required:

redshift:DescribeScheduledActions,
redshift:DescribeTags