Class ScheduledFargateTask

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.services.ecs.patterns.ScheduledTaskBase
software.amazon.awscdk.services.ecs.patterns.ScheduledFargateTask
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-08-02T00:29:10.470Z") @Stability(Stable) public class ScheduledFargateTask extends ScheduledTaskBase
A scheduled Fargate task that will be initiated off of CloudWatch Events.

Example:

 Vpc vpc = Vpc.Builder.create(this, "Vpc").maxAzs(1).build();
 Cluster cluster = Cluster.Builder.create(this, "EcsCluster").vpc(vpc).build();
 ScheduledFargateTask scheduledFargateTask = ScheduledFargateTask.Builder.create(this, "ScheduledFargateTask")
         .cluster(cluster)
         .scheduledFargateTaskImageOptions(ScheduledFargateTaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .memoryLimitMiB(512)
                 .build())
         .schedule(Schedule.expression("rate(1 minute)"))
         .tags(List.of(Tag.builder()
                 .key("my-tag")
                 .value("my-tag-value")
                 .build()))
         .build();
 
  • Constructor Details

    • ScheduledFargateTask

      protected ScheduledFargateTask(software.amazon.jsii.JsiiObjectRef objRef)
    • ScheduledFargateTask

      protected ScheduledFargateTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ScheduledFargateTask

      @Stability(Stable) public ScheduledFargateTask(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ScheduledFargateTaskProps props)
      Constructs a new instance of the ScheduledFargateTask class.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • getTask

      @Stability(Stable) @NotNull public EcsTask getTask()
      The ECS task in this construct.
    • getTaskDefinition

      @Stability(Stable) @NotNull public FargateTaskDefinition getTaskDefinition()
      The Fargate task definition in this construct.