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 | aws.autoscaling.scheduled_actions |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AutoScalingGroupName, 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_name,
min_size,
recurrence,
time_zone,
end_time,
auto_scaling_group_name,
start_time,
desired_capacity,
max_size
FROM aws.autoscaling.scheduled_actions
WHERE region = 'us-east-1';
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 aws.autoscaling.scheduled_actions
WHERE region = 'us-east-1' AND data__Identifier = '<ScheduledActionName>|<AutoScalingGroupName>';
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.autoscaling.scheduled_actions (
AutoScalingGroupName,
region
)
SELECT
'{{ AutoScalingGroupName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.autoscaling.scheduled_actions (
MinSize,
Recurrence,
TimeZone,
EndTime,
AutoScalingGroupName,
StartTime,
DesiredCapacity,
MaxSize,
region
)
SELECT
'{{ MinSize }}',
'{{ Recurrence }}',
'{{ TimeZone }}',
'{{ EndTime }}',
'{{ AutoScalingGroupName }}',
'{{ StartTime }}',
'{{ DesiredCapacity }}',
'{{ MaxSize }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: scheduled_action
props:
- name: MinSize
value: '{{ MinSize }}'
- name: Recurrence
value: '{{ Recurrence }}'
- name: TimeZone
value: '{{ TimeZone }}'
- name: EndTime
value: '{{ EndTime }}'
- name: AutoScalingGroupName
value: '{{ AutoScalingGroupName }}'
- name: StartTime
value: '{{ StartTime }}'
- name: DesiredCapacity
value: '{{ DesiredCapacity }}'
- name: MaxSize
value: '{{ MaxSize }}'
DELETE
example
/*+ delete */
DELETE FROM aws.autoscaling.scheduled_actions
WHERE data__Identifier = '<ScheduledActionName|AutoScalingGroupName>'
AND region = 'us-east-1';
Permissions
To operate on the scheduled_actions
resource, the following permissions are required:
Create
autoscaling:PutScheduledUpdateGroupAction,
autoscaling:DescribeScheduledActions
Read
autoscaling:DescribeScheduledActions
Update
autoscaling:PutScheduledUpdateGroupAction
Delete
autoscaling:DeleteScheduledAction,
autoscaling:DescribeScheduledActions
List
autoscaling:DescribeScheduledActions