putScheduledAction
Creates or updates a scheduled action for an Application Auto Scaling scalable target.
Each scalable target is identified by a service namespace, resource ID, and scalable dimension. A scheduled action applies to the scalable target identified by those three attributes. You cannot create a scheduled action until you have registered the resource as a scalable target.
When you specify start and end times with a recurring schedule using a cron expression or rates, they form the boundaries for when the recurring action starts and stops.
To update a scheduled action, specify the parameters that you want to change. If you don't specify start and end times, the old values are deleted.
For more information, see Scheduled scaling in the Application Auto Scaling User Guide.
If a scalable target is deregistered, the scalable target is no longer available to run scheduled actions. Any scheduled actions that were specified for the scalable target are deleted.
Samples
fun main() {
//sampleStart
// This example adds a scheduled action to a DynamoDB table called TestTable to scale out on a
// recurring schedule. On the specified schedule (every day at 12:15pm UTC), if the current capacity is below
// the value specified for MinCapacity, Application Auto Scaling scales out to the value specified by
// MinCapacity.
val resp = applicationAutoScalingClient.putScheduledAction {
serviceNamespace = ServiceNamespace.fromValue("dynamodb")
schedule = "cron(15 12 * * ? *)"
scheduledActionName = "my-recurring-action"
resourceId = "table/TestTable"
scalableDimension = ScalableDimension.fromValue("dynamodb:table:WriteCapacityUnits")
scalableTargetAction = ScalableTargetAction {
minCapacity = 6
}
}
//sampleEnd
}