Class Schedule


  • public class Schedule
    extends com.pulumi.resources.CustomResource
    Provides an AutoScaling Schedule resource. ## Example Usage <!--Start PulumiCodeChooser -->
     
     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.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 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());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import AutoScaling ScheduledAction using the `auto-scaling-group-name` and `scheduled-action-name`. For example: ```sh $ pulumi import aws:autoscaling/schedule:Schedule resource-name auto-scaling-group-name/scheduled-action-name ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • 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 Schedule get​(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> scheduledActionName()  
      com.pulumi.core.Output<java.lang.String> startTime()  
      com.pulumi.core.Output<java.lang.String> timeZone()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 autoscaling 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.
      • 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 `start_time` and `end_time` 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.