Class ScheduledTaskBase

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:48.811Z") @Stability(Stable) public abstract class ScheduledTaskBase extends Construct
The base class for ScheduledEc2Task and ScheduledFargateTask tasks.
  • Constructor Details

    • ScheduledTaskBase

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

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

      @Stability(Stable) protected ScheduledTaskBase(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ScheduledTaskBaseProps props)
      Constructs a new instance of the ScheduledTaskBase class.

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

    • addTaskAsTarget

      @Stability(Stable) protected void addTaskAsTarget(@NotNull EcsTask ecsTaskTarget)
      Adds task as a target of the scheduled event rule.

      Parameters:
      ecsTaskTarget - the EcsTask to add to the event rule. This parameter is required.
    • addTaskDefinitionToEventTarget

      @Stability(Stable) @NotNull protected EcsTask addTaskDefinitionToEventTarget(@NotNull TaskDefinition taskDefinition)
      Create an ECS task using the task definition provided and add it to the scheduled event rule.

      Parameters:
      taskDefinition - the TaskDefinition to add to the event rule. This parameter is required.
    • createAWSLogDriver

      @Stability(Stable) @NotNull protected AwsLogDriver createAWSLogDriver(@NotNull String prefix)
      Create an AWS Log Driver with the provided streamPrefix.

      Parameters:
      prefix - the Cloudwatch logging prefix. This parameter is required.
    • getDefaultCluster

      @Stability(Stable) @NotNull protected Cluster getDefaultCluster(@NotNull Construct scope, @Nullable IVpc vpc)
      Returns the default cluster.

      Parameters:
      scope - This parameter is required.
      vpc -
    • getDefaultCluster

      @Stability(Stable) @NotNull protected Cluster getDefaultCluster(@NotNull Construct scope)
      Returns the default cluster.

      Parameters:
      scope - This parameter is required.
    • getCluster

      @Stability(Stable) @NotNull public ICluster getCluster()
      The name of the cluster that hosts the service.
    • getDesiredTaskCount

      @Stability(Stable) @NotNull public Number getDesiredTaskCount()
      The desired number of instantiations of the task definition to keep running on the service.

      The minimum value is 1

    • getEventRule

      @Stability(Stable) @NotNull public Rule getEventRule()
      The CloudWatch Events rule for the service.
    • getSubnetSelection

      @Stability(Stable) @NotNull public SubnetSelection getSubnetSelection()
      In what subnets to place the task's ENIs.

      (Only applicable in case the TaskDefinition is configured for AwsVpc networking)

      Default: Private subnets