Class ScheduledAction


  • public class ScheduledAction
    extends com.pulumi.resources.CustomResource
    Provides an Application Auto Scaling 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.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 dynamodb = new Target("dynamodb", TargetArgs.builder()
                 .maxCapacity(100)
                 .minCapacity(5)
                 .resourceId("table/tableName")
                 .scalableDimension("dynamodb:table:ReadCapacityUnits")
                 .serviceNamespace("dynamodb")
                 .build());
     
             var dynamodbScheduledAction = new ScheduledAction("dynamodbScheduledAction", ScheduledActionArgs.builder()
                 .scalableTargetAction(ScheduledActionScalableTargetActionArgs.builder()
                     .minCapacity(1)
                     .maxCapacity(200)
                     .build())
                 .name("dynamodb")
                 .serviceNamespace(dynamodb.serviceNamespace())
                 .resourceId(dynamodb.resourceId())
                 .scalableDimension(dynamodb.scalableDimension())
                 .schedule("at(2006-01-02T15:04:05)")
                 .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.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 ecs = new Target("ecs", TargetArgs.builder()
                 .maxCapacity(4)
                 .minCapacity(1)
                 .resourceId("service/clusterName/serviceName")
                 .scalableDimension("ecs:service:DesiredCount")
                 .serviceNamespace("ecs")
                 .build());
     
             var ecsScheduledAction = new ScheduledAction("ecsScheduledAction", ScheduledActionArgs.builder()
                 .scalableTargetAction(ScheduledActionScalableTargetActionArgs.builder()
                     .minCapacity(1)
                     .maxCapacity(10)
                     .build())
                 .name("ecs")
                 .serviceNamespace(ecs.serviceNamespace())
                 .resourceId(ecs.resourceId())
                 .scalableDimension(ecs.scalableDimension())
                 .schedule("at(2006-01-02T15:04:05)")
                 .build());
     
         }
     }
     
     
    • 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
    • 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.util.Optional<java.lang.String>> endTime()  
      static ScheduledAction get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ScheduledActionState 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.String> name()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> resourceId()  
      com.pulumi.core.Output<java.lang.String> scalableDimension()  
      com.pulumi.core.Output<ScheduledActionScalableTargetAction> scalableTargetAction()  
      com.pulumi.core.Output<java.lang.String> schedule()  
      com.pulumi.core.Output<java.lang.String> serviceNamespace()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> startTime()  
      com.pulumi.core.Output<java.util.Optional<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

      • ScheduledAction

        public ScheduledAction​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • ScheduledAction

        public ScheduledAction​(java.lang.String name,
                               ScheduledActionArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • ScheduledAction

        public ScheduledAction​(java.lang.String name,
                               ScheduledActionArgs 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 of the scheduled action.
      • endTime

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> endTime()
        Returns:
        Date and time for the scheduled action to end in RFC 3339 format. The timezone is not affected by the setting of `timezone`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        Name of the scheduled action.
      • 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.
      • resourceId

        public com.pulumi.core.Output<java.lang.String> resourceId()
        Returns:
        Identifier of the resource associated with the scheduled action. Documentation can be found in the `ResourceId` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScheduledAction.html)
      • scalableDimension

        public com.pulumi.core.Output<java.lang.String> scalableDimension()
        Returns:
        Scalable dimension. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScheduledAction.html) Example: ecs:service:DesiredCount
      • scalableTargetAction

        public com.pulumi.core.Output<ScheduledActionScalableTargetAction> scalableTargetAction()
        Returns:
        New minimum and maximum capacity. You can set both values or just one. See below
      • schedule

        public com.pulumi.core.Output<java.lang.String> schedule()
        Returns:
        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](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScheduledAction.html)
      • serviceNamespace

        public com.pulumi.core.Output<java.lang.String> serviceNamespace()
        Returns:
        Namespace of the AWS service. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PutScheduledAction.html) Example: `ecs`
      • startTime

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> startTime()
        Returns:
        Date and time for the scheduled action to start in RFC 3339 format. The timezone is not affected by the setting of `timezone`.
      • timezone

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> timezone()
        Returns:
        Time zone used when setting a scheduled action by using an at or cron expression. Does not affect timezone for `startTime` and `endTime`. Valid values are the [canonical names of the IANA time zones supported by Joda-Time](https://www.joda.org/joda-time/timezones.html), such as `Etc/GMT+9` or `Pacific/Tahiti`. Default is `UTC`.
      • get

        public static ScheduledAction get​(java.lang.String name,
                                          com.pulumi.core.Output<java.lang.String> id,
                                          @Nullable
                                          ScheduledActionState 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.