Interface ScheduledEc2TaskImageOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, ScheduledTaskImageProps
All Known Implementing Classes:
ScheduledEc2TaskImageOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:01.287Z") @Stability(Stable) public interface ScheduledEc2TaskImageOptions extends software.amazon.jsii.JsiiSerializable, ScheduledTaskImageProps
The properties for the ScheduledEc2Task using an image.

Example:

 // Instantiate an Amazon EC2 Task to run at a scheduled interval
 Cluster cluster;
 ScheduledEc2Task ecsScheduledTask = ScheduledEc2Task.Builder.create(this, "ScheduledTask")
         .cluster(cluster)
         .scheduledEc2TaskImageOptions(ScheduledEc2TaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .memoryLimitMiB(256)
                 .environment(Map.of("name", "TRIGGER", "value", "CloudWatch Events"))
                 .build())
         .schedule(Schedule.expression("rate(1 minute)"))
         .enabled(true)
         .ruleName("sample-scheduled-task-rule")
         .build();
 
  • Method Details

    • getCpu

      @Stability(Stable) @Nullable default Number getCpu()
      The minimum number of CPU units to reserve for the container.

      Default: none

    • getMemoryLimitMiB

      @Stability(Stable) @Nullable default Number getMemoryLimitMiB()
      The hard limit (in MiB) of memory to present to the container.

      If your container attempts to exceed the allocated memory, the container is terminated.

      At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

      Default: - No memory limit.

    • getMemoryReservationMiB

      @Stability(Stable) @Nullable default Number getMemoryReservationMiB()
      The soft limit (in MiB) of memory to reserve for the container.

      When system memory is under contention, Docker attempts to keep the container memory within the limit. If the container requires more memory, it can consume up to the value specified by the Memory property or all of the available memory on the container instance—whichever comes first.

      At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.

      Default: - No memory reserved.

    • builder

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