PutScheduledUpdateGroupAction
Creates or updates a scheduled scaling action for an Auto Scaling group. If you leave a parameter unspecified when updating a scheduled scaling action, the corresponding value remains unchanged.
For more information, see Scheduled scaling in the Amazon EC2 Auto Scaling User Guide.
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
- AutoScalingGroupName
-
The name of the Auto Scaling group.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1600.
Pattern:
[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Required: Yes
- DesiredCapacity
-
The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions.
Type: Integer
Required: No
- EndTime
-
The date and time for the recurring schedule to end. Amazon EC2 Auto Scaling does not perform the action after this time.
Type: Timestamp
Required: No
- MaxSize
-
The maximum size of the Auto Scaling group.
Type: Integer
Required: No
- MinSize
-
The minimum size of the Auto Scaling group.
Type: Integer
Required: No
- Recurrence
-
The recurring schedule for this action, in Unix cron syntax format. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example,
"30 0 1 1,6,12 *"
). For more information about this format, see Crontab. When
StartTime
andEndTime
are specified withRecurrence
, they form the boundaries of when the recurring action starts and stops.Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Required: No
- ScheduledActionName
-
The name of this scaling action.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Required: Yes
- StartTime
-
The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example,
"2019-06-01T00:00:00Z"
).If you specify
Recurrence
andStartTime
, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence.If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message.
Type: Timestamp
Required: No
- Time
-
This parameter is no longer used.
Type: Timestamp
Required: No
Errors
For information about the errors that are common to all actions, see Common Errors.
- AlreadyExists
-
You already have an Auto Scaling group or launch configuration with this name.
HTTP Status Code: 400
- LimitExceeded
-
You have already reached a limit for your Amazon EC2 Auto Scaling resources (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see DescribeAccountLimits.
HTTP Status Code: 400
- ResourceContention
-
You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
HTTP Status Code: 500
Examples
Example 1: Schedule based on a specific date and time
This example illustrates one usage of PutScheduledUpdateGroupAction.
Sample Request
https://autoscaling.amazonaws.com/?Action=PutScheduledUpdateGroupAction
&AutoScalingGroupName=my-asg
&ScheduledActionName=scaleout
&StartTime=2019-05-25T08:00:00Z
&DesiredCapacity=3
&Version=2011-01-01
&AUTHPARAMS
Example 2: Recurring Schedule
This example illustrates one usage of PutScheduledUpdateGroupAction.
Sample Request
https://autoscaling.amazonaws.com/?Action="PutScheduledUpdateGroupAction
&AutoScalingGroupName=my-asg
&ScheduledActionName=scaleout-schedule-year
&Recurrence="30 0 1 1,6,12 *"
&DesiredCapacity=3
&Version=2011-01-01
&AUTHPARAMS
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: