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 = 'us-east-1' 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 = 'us-east-1';
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 }}';
/*+ 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 }}';
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.autoscaling.scheduled_actions
WHERE
Identifier = '{{ scheduled_action_name }}|{{ auto_scaling_group_name }}' AND
region = 'us-east-1';
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