Scheduled scaling - Amazon ElastiCache for Redis
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Scheduled scaling

Scaling based on a schedule enables you to scale your application in response to predictable changes in demand. To use scheduled scaling, you create scheduled actions, which tell ElastiCache for Redis to perform scaling activities at specific times. When you create a scheduled action, you specify an existing ElastiCache for Redis cluster, when the scaling activity should occur, minimum capacity, and maximum capacity. You can create scheduled actions that scale one time only or that scale on a recurring schedule.

You can only create a scheduled action for ElastiCache for Redis clusters that already exist. You can't create a scheduled action at the same time that you create a cluster.

For more information on terminology for scheduled action creation, management, and deletion, see Commonly used commands for scheduled action creation, management, and deletion

To create on a recurring schedule:

  1. Sign in to the Amazon Web Services Management Console and open the Amazon ElastiCache console at https://console.amazonaws.cn/elasticache/.

  2. In the navigation pane, choose Redis.

  3. Choose the cluster that you want to add a policy for.

  4. Choose the Manage Auto Scaling policie from the Actions dropdown.

  5. Choose the Auto Scaling policies tab.

  6. In the Auto scaling policies section, the Add Scaling policy dialog box appears. Choose Scheduled scaling.

  7. For Policy Name, enter the policy name.

  8. For Scalable Dimension, choose Shards.

  9. For Target Shards, choose the value.

  10. For Recurrence, choose Recurring.

  11. For Frequency, choose the respective value.

  12. For Start Date and Start time, choose the time from when the policy will go into effect.

  13. Choose Add Policy.

To create a one-time scheduled action:

  1. Sign in to the Amazon Web Services Management Console and open the Amazon ElastiCache console at https://console.amazonaws.cn/elasticache/.

  2. In the navigation pane, choose Redis.

  3. Choose the cluster that you want to add a policy for.

  4. Choose the Manage Auto Scaling policie from the Actions dropdown.

  5. Choose the Auto Scaling policies tab.

  6. In the Auto scaling policies section, the Add Scaling policy dialog box appears. Choose Scheduled scaling.

  7. For Policy Name, enter the policy name.

  8. For Scalable Dimension, choose Shards.

  9. For Target Shards, choose the value.

  10. For Recurrence, choose One Time.

  11. For Start Date and Start time, choose the time from when the policy will go into effect.

  12. For End Date choose the date until when the policy would be in effect.

  13. Choose Add Policy.

To delete a scheduled action

  1. Sign in to the Amazon Web Services Management Console and open the Amazon ElastiCache console at https://console.amazonaws.cn/elasticache/.

  2. In the navigation pane, choose Redis.

  3. Choose the cluster that you want to add a policy for.

  4. Choose the Manage Auto Scaling policie from the Actions dropdown.

  5. Choose the Auto Scaling policies tab.

  6. In the Auto scaling policies section, choose the auto scaling policy, and then choose Delete from the Actions dialog.

To manage scheduled scaling using the Amazon CLI

Use the following application-autoscaling APIs:

Use Amazon CloudFormation to create a scheduled action

This snippet shows how to create a target tracking policy and apply it to an AWS::ElastiCache::ReplicationGroup resource using the AWS::ApplicationAutoScaling::ScalableTarget resource. It uses the Fn::Join and Ref intrinsic functions to construct the ResourceId property with the logical name of the AWS::ElastiCache::ReplicationGroup resource that is specified in the same template.

ScalingTarget: Type: 'AWS::ApplicationAutoScaling::ScalableTarget' Properties: MaxCapacity: 3 MinCapacity: 1 ResourceId: !Sub replication-group/${logicalName} ScalableDimension: 'elasticache:replication-group:NodeGroups' ServiceNamespace: elasticache RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/elasticache.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_ElastiCacheRG" ScheduledActions: - EndTime: '2020-12-31T12:00:00.000Z' ScalableTargetAction: MaxCapacity: '5' MinCapacity: '2' ScheduledActionName: First Schedule: 'cron(0 18 * * ? *)'