scheduled_actions
Creates, updates, deletes or gets a scheduled_action
resource or lists scheduled_actions
in a region
Overview
Name | scheduled_actions |
Type | Resource |
Description | The `AWS::Redshift::ScheduledAction` resource creates an Amazon Redshift Scheduled Action. |
Id | aws.redshift.scheduled_actions |
Fields
Name | Datatype | Description |
---|---|---|
scheduled_action_description | string | The description of the scheduled action. |
scheduled_action_name | string | The name of the scheduled action. The name must be unique within an account. |
end_time | string | The end time in UTC of the scheduled action. After this time, the scheduled action does not trigger. |
state | string | The state of the scheduled action. |
schedule | string | The schedule in `at( )` or `cron( )` format. |
iam_role | string | The IAM role to assume to run the target action. |
start_time | string | The start time in UTC of the scheduled action. Before this time, the scheduled action does not trigger. |
enable | boolean | If true, the schedule is enabled. If false, the scheduled action does not trigger. |
target_action | object | A JSON format string of the Amazon Redshift API operation with input parameters. |
next_invocations | array | List of times when the scheduled action will run. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ScheduledActionName, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all scheduled_actions
in a region.
SELECT
region,
scheduled_action_description,
scheduled_action_name,
end_time,
state,
schedule,
iam_role,
start_time,
enable,
target_action,
next_invocations
FROM aws.redshift.scheduled_actions
WHERE region = 'us-east-1';
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 aws.redshift.scheduled_actions
WHERE region = 'us-east-1' AND data__Identifier = '<ScheduledActionName>';
INSERT
example
Use the following StackQL query and manifest file to create a new scheduled_action
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.redshift.scheduled_actions (
ScheduledActionName,
region
)
SELECT
'{{ ScheduledActionName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.redshift.scheduled_actions (
ScheduledActionDescription,
ScheduledActionName,
EndTime,
Schedule,
IamRole,
StartTime,
Enable,
TargetAction,
region
)
SELECT
'{{ ScheduledActionDescription }}',
'{{ ScheduledActionName }}',
'{{ EndTime }}',
'{{ Schedule }}',
'{{ IamRole }}',
'{{ StartTime }}',
'{{ Enable }}',
'{{ TargetAction }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: scheduled_action
props:
- name: ScheduledActionDescription
value: '{{ ScheduledActionDescription }}'
- name: ScheduledActionName
value: '{{ ScheduledActionName }}'
- name: EndTime
value: '{{ EndTime }}'
- name: Schedule
value: '{{ Schedule }}'
- name: IamRole
value: '{{ IamRole }}'
- name: StartTime
value: null
- name: Enable
value: '{{ Enable }}'
- name: TargetAction
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.redshift.scheduled_actions
WHERE data__Identifier = '<ScheduledActionName>'
AND region = 'us-east-1';
Permissions
To operate on the scheduled_actions
resource, the following permissions are required:
Read
redshift:DescribeScheduledActions,
redshift:DescribeTags
Create
redshift:CreateScheduledAction,
redshift:DescribeScheduledActions,
redshift:DescribeTags,
redshift:PauseCluster,
redshift:ResumeCluster,
redshift:ResizeCluster,
iam:PassRole
Update
redshift:DescribeScheduledActions,
redshift:ModifyScheduledAction,
redshift:PauseCluster,
redshift:ResumeCluster,
redshift:ResizeCluster,
redshift:DescribeTags,
iam:PassRole
List
redshift:DescribeTags,
redshift:DescribeScheduledActions
Delete
redshift:DescribeTags,
redshift:DescribeScheduledActions,
redshift:DeleteScheduledAction