Scheduled scaling - Amazon ElastiCache (Redis OSS)
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 (PDF).

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 (Redis OSS) to perform scaling activities at specific times. When you create a scheduled action, you specify an existing ElastiCache (Redis OSS) 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 (Redis OSS) 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 a one-time scheduled action:

Similar to Shard dimension. See Scheduled scaling .

To delete a scheduled action

Similar to Shard dimension. See Scheduled scaling .

To manage scheduled scaling using the Amazon CLI

Use the following application-autoscaling APIs:

Use Amazon CloudFormation to create Auto Scaling policies

This snippet shows how to create a scheduled action 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: 0 MinCapacity: 0 ResourceId: !Sub replication-group/${logicalName} ScalableDimension: 'elasticache:replication-group:Replicas' 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 * * ? *)'