There are more AWS SDK examples available in the AWS Doc SDK Examples
Use PutScheduledAction
with a CLI
The following code examples show how to use PutScheduledAction
.
- CLI
-
- AWS CLI
-
To add a scheduled action to a DynamoDB table
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.
Command:
aws application-autoscaling put-scheduled-action --service-namespace
dynamodb
--scheduled-action-namemy-recurring-action
--schedule"cron(15 12 * * ? *)"
--resource-idtable/TestTable
--scalable-dimensiondynamodb:table:WriteCapacityUnits
--scalable-target-actionMinCapacity=6
For more information, see Scheduled Scaling in the Application Auto Scaling User Guide.
-
For API details, see PutScheduledAction
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell
-
Example 1: This cmdlet 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.
Set-AASScheduledAction -ServiceNamespace AppStream -ResourceId fleet/MyFleet -Schedule "cron(0 0 8 ? * MON-FRI *)" -ScalableDimension appstream:fleet:DesiredCapacity -ScheduledActionName WeekDaysFleetScaling -ScalableTargetAction_MinCapacity 5 -ScalableTargetAction_MaxCapacity 10
-
For API details, see PutScheduledAction in AWS Tools for PowerShell Cmdlet Reference.
-