Package com.pulumi.aws.autoscaling
Class Schedule
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.autoscaling.Schedule
-
public class Schedule extends com.pulumi.resources.CustomResourceProvides an AutoScaling Schedule resource. ## Example Usage
## Import ### Identity Schema #### Required * `autoscalingGroupName` (String) Name of the Auto Scaling group. * `scheduledActionName` (String) Name of the scaling action. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import AutoScaling Schedules using `autoscalingGroupName` and `scheduledActionName` separated by a forward slash (`/`). For example: ```sh $ pulumi import aws:autoscaling/schedule:Schedule example example-asg/example-action ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.autoscaling.Group; import com.pulumi.aws.autoscaling.GroupArgs; import com.pulumi.aws.autoscaling.Schedule; import com.pulumi.aws.autoscaling.ScheduleArgs; import java.util.ArrayList; import java.util.Arrays; 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 foobar = new Group("foobar", GroupArgs.builder() .availabilityZones("us-west-2a") .name("test-foobar5") .maxSize(1) .minSize(1) .healthCheckGracePeriod(300) .healthCheckType("ELB") .forceDelete(true) .terminationPolicies("OldestInstance") .build()); var foobarSchedule = new Schedule("foobarSchedule", ScheduleArgs.builder() .scheduledActionName("foobar") .minSize(0) .maxSize(1) .desiredCapacity(0) .startTime("2016-12-11T18:00:00Z") .endTime("2016-12-12T06:00:00Z") .autoscalingGroupName(foobar.name()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description Schedule(java.lang.String name)Schedule(java.lang.String name, ScheduleArgs args)Schedule(java.lang.String name, ScheduleArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>arn()com.pulumi.core.Output<java.lang.String>autoscalingGroupName()com.pulumi.core.Output<java.lang.Integer>desiredCapacity()com.pulumi.core.Output<java.lang.String>endTime()static Scheduleget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ScheduleState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.Integer>maxSize()com.pulumi.core.Output<java.lang.Integer>minSize()com.pulumi.core.Output<java.lang.String>recurrence()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.lang.String>scheduledActionName()com.pulumi.core.Output<java.lang.String>startTime()com.pulumi.core.Output<java.lang.String>timeZone()
-
-
-
Constructor Detail
-
Schedule
public Schedule(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Schedule
public Schedule(java.lang.String name, ScheduleArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Schedule
public Schedule(java.lang.String name, ScheduleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN assigned by AWS to the Auto Scaling schedule.
-
autoscalingGroupName
public com.pulumi.core.Output<java.lang.String> autoscalingGroupName()
- Returns:
- The name of the Auto Scaling group.
-
desiredCapacity
public com.pulumi.core.Output<java.lang.Integer> desiredCapacity()
- Returns:
- The initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. Set to `-1` if you don't want to change the desired capacity at the scheduled time. Defaults to `0`.
-
endTime
public com.pulumi.core.Output<java.lang.String> endTime()
- Returns:
- The date and time for the recurring schedule to end, in UTC with the format `"YYYY-MM-DDThh:mm:ssZ"` (e.g. `"2021-06-01T00:00:00Z"`).
-
maxSize
public com.pulumi.core.Output<java.lang.Integer> maxSize()
- Returns:
- The maximum size of the Auto Scaling group. Set to `-1` if you don't want to change the maximum size at the scheduled time. Defaults to `0`.
-
minSize
public com.pulumi.core.Output<java.lang.Integer> minSize()
- Returns:
- The minimum size of the Auto Scaling group. Set to `-1` if you don't want to change the minimum size at the scheduled time. Defaults to `0`.
-
recurrence
public com.pulumi.core.Output<java.lang.String> recurrence()
- Returns:
- The recurring schedule for this action specified using the Unix cron syntax format.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
scheduledActionName
public com.pulumi.core.Output<java.lang.String> scheduledActionName()
- Returns:
- The name of this scaling action. The following arguments are optional:
-
startTime
public com.pulumi.core.Output<java.lang.String> startTime()
- Returns:
- The date and time for the recurring schedule to start, in UTC with the format `"YYYY-MM-DDThh:mm:ssZ"` (e.g. `"2021-06-01T00:00:00Z"`).
-
timeZone
public com.pulumi.core.Output<java.lang.String> timeZone()
- Returns:
- Specifies the time zone for a cron expression. Valid values are the canonical names of the IANA time zones (such as `Etc/GMT+9` or `Pacific/Tahiti`). > **NOTE:** When `startTime` and `endTime` are specified with `recurrence` , they form the boundaries of when the recurring action will start and stop.
-
get
public static Schedule get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ScheduleState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-