Scheduled Action Args
Provides an Application AutoScaling ScheduledAction resource.
Example Usage
DynamoDB Table Autoscaling
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appautoscaling.Target;
import com.pulumi.aws.appautoscaling.TargetArgs;
import com.pulumi.aws.appautoscaling.ScheduledAction;
import com.pulumi.aws.appautoscaling.ScheduledActionArgs;
import com.pulumi.aws.appautoscaling.inputs.ScheduledActionScalableTargetActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var dynamodbTarget = new Target("dynamodbTarget", TargetArgs.builder()
.maxCapacity(100)
.minCapacity(5)
.resourceId("table/tableName")
.scalableDimension("dynamodb:table:ReadCapacityUnits")
.serviceNamespace("dynamodb")
.build());
var dynamodbScheduledAction = new ScheduledAction("dynamodbScheduledAction", ScheduledActionArgs.builder()
.serviceNamespace(dynamodbTarget.serviceNamespace())
.resourceId(dynamodbTarget.resourceId())
.scalableDimension(dynamodbTarget.scalableDimension())
.schedule("at(2006-01-02T15:04:05)")
.scalableTargetAction(ScheduledActionScalableTargetActionArgs.builder()
.minCapacity(1)
.maxCapacity(200)
.build())
.build());
}
}
ECS Service Autoscaling
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.appautoscaling.Target;
import com.pulumi.aws.appautoscaling.TargetArgs;
import com.pulumi.aws.appautoscaling.ScheduledAction;
import com.pulumi.aws.appautoscaling.ScheduledActionArgs;
import com.pulumi.aws.appautoscaling.inputs.ScheduledActionScalableTargetActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var ecsTarget = new Target("ecsTarget", TargetArgs.builder()
.maxCapacity(4)
.minCapacity(1)
.resourceId("service/clusterName/serviceName")
.scalableDimension("ecs:service:DesiredCount")
.serviceNamespace("ecs")
.build());
var ecsScheduledAction = new ScheduledAction("ecsScheduledAction", ScheduledActionArgs.builder()
.serviceNamespace(ecsTarget.serviceNamespace())
.resourceId(ecsTarget.resourceId())
.scalableDimension(ecsTarget.scalableDimension())
.schedule("at(2006-01-02T15:04:05)")
.scalableTargetAction(ScheduledActionScalableTargetActionArgs.builder()
.minCapacity(1)
.maxCapacity(10)
.build())
.build());
}
}
Constructors
Properties
Identifier of the resource associated with the scheduled action. Documentation can be found in the ResourceId
parameter at: AWS Application Auto Scaling API Reference
Scalable dimension. Documentation can be found in the ScalableDimension
parameter at: AWS Application Auto Scaling API Reference Example: ecs:service:DesiredCount
New minimum and maximum capacity. You can set both values or just one. See below
Schedule for this action. The following formats are supported: At expressions - at(yyyy-mm-ddThh:mm:ss), Rate expressions - rate(valueunit), Cron expressions - cron(fields). Times for at expressions and cron expressions are evaluated using the time zone configured in timezone
. Documentation can be found in the Timezone
parameter at: AWS Application Auto Scaling API Reference
Namespace of the AWS service. Documentation can be found in the ServiceNamespace
parameter at: AWS Application Auto Scaling API Reference Example: ecs
Time zone used when setting a scheduled action by using an at or cron expression. Does not affect timezone for start_time
and end_time
. Valid values are the canonical names of the IANA time zones supported by Joda-Time, such as Etc/GMT+9
or Pacific/Tahiti
. Default is UTC
.