Use Amazon CloudFormation for Auto Scaling policies - 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).

Use Amazon CloudFormation for 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" ScalingPolicy: Type: "AWS::ApplicationAutoScaling::ScalingPolicy" Properties: ScalingTargetId: !Ref ScalingTarget ServiceNamespace: elasticache PolicyName: testpolicy PolicyType: TargetTrackingScaling ScalableDimension: 'elasticache:replication-group:Replicas' TargetTrackingScalingPolicyConfiguration: PredefinedMetricSpecification: PredefinedMetricType: ElastiCacheReplicaEngineCPUUtilization TargetValue: 40