Пример #1
0
 public MyStack()
 {
     var ecsTarget = new Aws.AppAutoScaling.Target("ecsTarget", new Aws.AppAutoScaling.TargetArgs
     {
         MaxCapacity       = 4,
         MinCapacity       = 1,
         ResourceId        = "service/clusterName/serviceName",
         ScalableDimension = "ecs:service:DesiredCount",
         ServiceNamespace  = "ecs",
     });
     var ecsScheduledAction = new Aws.AppAutoScaling.ScheduledAction("ecsScheduledAction", new Aws.AppAutoScaling.ScheduledActionArgs
     {
         ResourceId           = ecsTarget.ResourceId,
         ScalableDimension    = ecsTarget.ScalableDimension,
         ScalableTargetAction = new Aws.AppAutoScaling.Inputs.ScheduledActionScalableTargetActionArgs
         {
             MaxCapacity = 10,
             MinCapacity = 1,
         },
         Schedule         = "at(2006-01-02T15:04:05)",
         ServiceNamespace = ecsTarget.ServiceNamespace,
     });
 }
Пример #2
0
 public MyStack()
 {
     var dynamodbTarget = new Aws.AppAutoScaling.Target("dynamodbTarget", new Aws.AppAutoScaling.TargetArgs
     {
         MaxCapacity       = 100,
         MinCapacity       = 5,
         ResourceId        = "table/tableName",
         ScalableDimension = "dynamodb:table:ReadCapacityUnits",
         ServiceNamespace  = "dynamodb",
     });
     var dynamodbScheduledAction = new Aws.AppAutoScaling.ScheduledAction("dynamodbScheduledAction", new Aws.AppAutoScaling.ScheduledActionArgs
     {
         ResourceId           = dynamodbTarget.ResourceId,
         ScalableDimension    = dynamodbTarget.ScalableDimension,
         ScalableTargetAction = new Aws.AppAutoScaling.Inputs.ScheduledActionScalableTargetActionArgs
         {
             MaxCapacity = 200,
             MinCapacity = 1,
         },
         Schedule         = "at(2006-01-02T15:04:05)",
         ServiceNamespace = dynamodbTarget.ServiceNamespace,
     });
 }