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 | awscc.redshift.scheduled_actions |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
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. |
| Name | Datatype | Description |
|---|---|---|
scheduled_action_name | string | The name of the scheduled action. The name must be unique within an account. |
schedule | string | The schedule in at( ) or cron( ) format. |
region | string | AWS region. |
For more information, see AWS::Redshift::ScheduledAction.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | scheduled_actions | INSERT | ScheduledActionName, region |
delete_resource | scheduled_actions | DELETE | Identifier, region |
update_resource | scheduled_actions | UPDATE | Identifier, PatchDocument, region |
list_resources | scheduled_actions_list_only | SELECT | region |
get_resource | scheduled_actions | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all scheduled_actions in a region.
SELECT
region,
scheduled_action_name
FROM awscc.redshift.scheduled_actions_list_only
WHERE
region = '{{ region }}';
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 awscc.redshift.scheduled_actions (
ScheduledActionName,
region
)
SELECT
'{{ scheduled_action_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.redshift.scheduled_actions (
ScheduledActionDescription,
ScheduledActionName,
EndTime,
Schedule,
IamRole,
StartTime,
Enable,
TargetAction,
region
)
SELECT
'{{ scheduled_action_description }}',
'{{ scheduled_action_name }}',
'{{ end_time }}',
'{{ schedule }}',
'{{ iam_role }}',
'{{ start_time }}',
'{{ enable }}',
'{{ target_action }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: scheduled_action
props:
- name: scheduled_action_description
value: '{{ scheduled_action_description }}'
- name: scheduled_action_name
value: '{{ scheduled_action_name }}'
- name: end_time
value: '{{ end_time }}'
- name: schedule
value: '{{ schedule }}'
- name: iam_role
value: '{{ iam_role }}'
- name: start_time
value: null
- name: enable
value: '{{ enable }}'
- name: target_action
value: {}
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:
| Parameter | Description |
|---|---|
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:
- Read
- Create
- Update
- List
- Delete
redshift:DescribeScheduledActions,
redshift:DescribeTags
redshift:CreateScheduledAction,
redshift:DescribeScheduledActions,
redshift:DescribeTags,
redshift:PauseCluster,
redshift:ResumeCluster,
redshift:ResizeCluster,
iam:PassRole
redshift:DescribeScheduledActions,
redshift:ModifyScheduledAction,
redshift:PauseCluster,
redshift:ResumeCluster,
redshift:ResizeCluster,
redshift:DescribeTags,
iam:PassRole
redshift:DescribeTags,
redshift:DescribeScheduledActions
redshift:DescribeTags,
redshift:DescribeScheduledActions,
redshift:DeleteScheduledAction