scheduled_actions
Creates, updates, deletes, gets or lists a scheduled_actions resource.
Overview
| Name | scheduled_actions |
| Type | Resource |
| Id | aws.redshift.scheduled_actions |
Fields
The following fields are returned by SELECT queries:
- describe_scheduled_actions
| Name | Datatype | Description |
|---|---|---|
end_time | string | The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger. |
iam_role | string | The 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_invocations | string | List of times when the scheduled action will run. |
schedule | string | The 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_description | string | The description of the scheduled action. |
scheduled_action_name | string | The name of the scheduled action. |
start_time | string | The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger. |
state | string | The state of the scheduled action. For example, DISABLED. |
target_action | string | A 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_scheduled_actions | select | region | ScheduledActionName, TargetActionType, StartTime, EndTime, Active, Filters, Marker, MaxRecords | Describes properties of scheduled actions. |
create_scheduled_action | insert | ScheduledActionName, TargetAction, IamRole, region | Schedule, ScheduledActionDescription, StartTime, EndTime, Enable | 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. |
modify_scheduled_action | update | ScheduledActionName, region | TargetAction, Schedule, IamRole, ScheduledActionDescription, StartTime, EndTime, Enable | Modifies a scheduled action. |
delete_scheduled_action | delete | ScheduledActionName, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
IamRole | string | The IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction. |
ScheduledActionName | string | The name of the scheduled action to delete. |
TargetAction | object | A JSON format string of the Amazon Redshift API operation with input parameters. For more information about this parameter, see ScheduledAction. |
region | string | AWS region (default: us-east-1) |
Active | boolean | If true, retrieve only active scheduled actions. If false, retrieve only disabled scheduled actions. |
Enable | boolean | A modified enable flag of the scheduled action. If true, the scheduled action is active. If false, the scheduled action is disabled. |
EndTime | string (date-time) | A modified end time of the scheduled action. For more information about this parameter, see ScheduledAction. |
Filters | array | List of scheduled action filters. |
IamRole | string | A different IAM role to assume to run the target action. For more information about this parameter, see ScheduledAction. |
Marker | string | An 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. |
MaxRecords | integer | The 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. |
Schedule | string | A modified schedule in either at( ) or cron( ) format. For more information about this parameter, see ScheduledAction. |
ScheduledActionDescription | string | A modified description of the scheduled action. |
ScheduledActionName | string | The name of the scheduled action to retrieve. |
StartTime | string (date-time) | A modified start time of the scheduled action. For more information about this parameter, see ScheduledAction. |
TargetAction | object | A modified JSON format of the scheduled action. For more information about this parameter, see ScheduledAction. |
TargetActionType | string | The type of the scheduled actions to retrieve. |
SELECT examples
- describe_scheduled_actions
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
- create_scheduled_action
- Manifest
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
;
# Description fields are for documentation purposes
- name: scheduled_actions
props:
- name: ScheduledActionName
value: "{{ ScheduledActionName }}"
description: Required parameter for the scheduled_actions resource.
- name: TargetAction
value: "{{ TargetAction }}"
description: Required parameter for the scheduled_actions resource.
- name: IamRole
value: "{{ IamRole }}"
description: Required parameter for the scheduled_actions resource.
- name: region
value: "{{ region }}"
description: Required parameter for the scheduled_actions resource.
- name: Schedule
value: "{{ Schedule }}"
description: The schedule in at( ) or cron( ) format. For more information about this parameter, see ScheduledAction.
description: The schedule in at( ) or cron( ) format. For more information about this parameter, see ScheduledAction.
- name: ScheduledActionDescription
value: "{{ ScheduledActionDescription }}"
description: The description of the scheduled action.
description: The description of the scheduled action.
- name: StartTime
value: "{{ StartTime }}"
description: The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction.
description: The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction.
- name: EndTime
value: "{{ EndTime }}"
description: The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction.
description: The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger. For more information about this parameter, see ScheduledAction.
- name: Enable
value: {{ Enable }}
description: If true, the schedule is enabled. If false, the scheduled action does not trigger. For more information about state of the scheduled action, see ScheduledAction.
description: If true, the schedule is enabled. If false, the scheduled action does not trigger. For more information about state of the scheduled action, see ScheduledAction.
UPDATE examples
- modify_scheduled_action
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
- delete_scheduled_action
Deletes a scheduled action.
DELETE FROM aws.redshift.scheduled_actions
WHERE ScheduledActionName = '{{ ScheduledActionName }}' --required
AND region = '{{ region }}' --required
;