All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CronOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:37.365Z") @Stability(Stable) public interface CronOptions extends software.amazon.jsii.JsiiSerializable
Options to configure a cron expression.

All fields are strings so you can use complex expressions. Absence of a field implies '*' or '?', whichever one is appropriate.

Example:

 Cluster cluster;
 ApplicationLoadBalancedFargateService loadBalancedFargateService = ApplicationLoadBalancedFargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(1024)
         .desiredCount(1)
         .cpu(512)
         .taskImageOptions(ApplicationLoadBalancedTaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .build())
         .build();
 ScalableTaskCount scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount(EnableScalingProps.builder()
         .minCapacity(5)
         .maxCapacity(20)
         .build());
 scalableTarget.scaleOnSchedule("DaytimeScaleDown", ScalingSchedule.builder()
         .schedule(Schedule.cron(CronOptions.builder().hour("8").minute("0").build()))
         .minCapacity(1)
         .build());
 scalableTarget.scaleOnSchedule("EveningRushScaleUp", ScalingSchedule.builder()
         .schedule(Schedule.cron(CronOptions.builder().hour("20").minute("0").build()))
         .minCapacity(10)
         .build());
 

See Also:
  • Method Details

    • getDay

      @Stability(Stable) @Nullable default String getDay()
      The day of the month to run this rule at.

      Default: - Every day of the month

    • getHour

      @Stability(Stable) @Nullable default String getHour()
      The hour to run this rule at.

      Default: - Every hour

    • getMinute

      @Stability(Stable) @Nullable default String getMinute()
      The minute to run this rule at.

      Default: - Every minute

    • getMonth

      @Stability(Stable) @Nullable default String getMonth()
      The month to run this rule at.

      Default: - Every month

    • getWeekDay

      @Stability(Stable) @Nullable default String getWeekDay()
      The day of the week to run this rule at.

      Default: - Any day of the week

    • getYear

      @Stability(Stable) @Nullable default String getYear()
      The year to run this rule at.

      Default: - Every year

    • builder

      @Stability(Stable) static CronOptions.Builder builder()
      Returns:
      a CronOptions.Builder of CronOptions