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::AutoScaling::ScheduledAction resource specifies an Amazon EC2 Auto Scaling scheduled action so that the Auto Scaling group can change the number of instances available for your application in response to predictable load changes. |
| Id | awscc.autoscaling.scheduled_actions |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
scheduled_action_name | string | Auto-generated unique identifier |
min_size | integer | The minimum size of the Auto Scaling group. |
recurrence | string | The recurring schedule for the action, in Unix cron syntax format. When StartTime and EndTime are specified with Recurrence , they form the boundaries of when the recurring action starts and stops. |
time_zone | string | The time zone for the cron expression. |
end_time | string | The latest scheduled start time to return. If scheduled action names are provided, this parameter is ignored. |
auto_scaling_group_name | string | The name of the Auto Scaling group. |
start_time | string | The earliest scheduled start time to return. If scheduled action names are provided, this parameter is ignored. |
desired_capacity | integer | The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. |
max_size | integer | The minimum size of the Auto Scaling group. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
scheduled_action_name | string | Auto-generated unique identifier |
auto_scaling_group_name | string | The name of the Auto Scaling group. |
region | string | AWS region. |
For more information, see AWS::AutoScaling::ScheduledAction.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | scheduled_actions | INSERT | AutoScalingGroupName, 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_name,
min_size,
recurrence,
time_zone,
end_time,
auto_scaling_group_name,
start_time,
desired_capacity,
max_size
FROM awscc.autoscaling.scheduled_actions
WHERE
region = '{{ region }}' AND
Identifier = '{{ scheduled_action_name }}|{{ auto_scaling_group_name }}';
Lists all scheduled_actions in a region.
SELECT
region,
scheduled_action_name,
auto_scaling_group_name
FROM awscc.autoscaling.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.autoscaling.scheduled_actions (
AutoScalingGroupName,
region
)
SELECT
'{{ auto_scaling_group_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.autoscaling.scheduled_actions (
MinSize,
Recurrence,
TimeZone,
EndTime,
AutoScalingGroupName,
StartTime,
DesiredCapacity,
MaxSize,
region
)
SELECT
'{{ min_size }}',
'{{ recurrence }}',
'{{ time_zone }}',
'{{ end_time }}',
'{{ auto_scaling_group_name }}',
'{{ start_time }}',
'{{ desired_capacity }}',
'{{ max_size }}',
'{{ 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: min_size
value: '{{ min_size }}'
- name: recurrence
value: '{{ recurrence }}'
- name: time_zone
value: '{{ time_zone }}'
- name: end_time
value: '{{ end_time }}'
- name: auto_scaling_group_name
value: '{{ auto_scaling_group_name }}'
- name: start_time
value: '{{ start_time }}'
- name: desired_capacity
value: '{{ desired_capacity }}'
- name: max_size
value: '{{ max_size }}'
UPDATE example
Use the following StackQL query and manifest file to update a scheduled_action resource, using stack-deploy.
/*+ update */
UPDATE awscc.autoscaling.scheduled_actions
SET PatchDocument = string('{{ {
"MinSize": min_size,
"Recurrence": recurrence,
"TimeZone": time_zone,
"EndTime": end_time,
"StartTime": start_time,
"DesiredCapacity": desired_capacity,
"MaxSize": max_size
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ scheduled_action_name }}|{{ auto_scaling_group_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.autoscaling.scheduled_actions
WHERE
Identifier = '{{ scheduled_action_name }}|{{ auto_scaling_group_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:
- Create
- Read
- Update
- Delete
- List
autoscaling:PutScheduledUpdateGroupAction,
autoscaling:DescribeScheduledActions
autoscaling:DescribeScheduledActions
autoscaling:PutScheduledUpdateGroupAction
autoscaling:DeleteScheduledAction,
autoscaling:DescribeScheduledActions
autoscaling:DescribeScheduledActions