java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.EcsTask
All Implemented Interfaces:
IRuleTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.726Z") @Stability(Stable) public class EcsTask extends software.amazon.jsii.JsiiObject implements IRuleTarget
Start a task on an ECS cluster.

Example:

 import software.amazon.awscdk.services.events.Rule;
 import software.amazon.awscdk.services.events.Schedule;
 import software.amazon.awscdk.services.events.targets.EcsTask;
 import software.amazon.awscdk.services.ecs.Cluster;
 import software.amazon.awscdk.services.ecs.TaskDefinition;
 import software.amazon.awscdk.services.iam.Role;
 Cluster cluster;
 TaskDefinition taskDefinition;
 Role role;
 EcsTask ecsTaskTarget = EcsTask.Builder.create().cluster(cluster).taskDefinition(taskDefinition).role(role).build();
 Rule.Builder.create(this, "ScheduleRule")
         .schedule(Schedule.cron(CronOptions.builder().minute("0").hour("4").build()))
         .targets(List.of(ecsTaskTarget))
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for EcsTask.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.services.events.IRuleTarget

    IRuleTarget.Jsii$Default, IRuleTarget.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
     
    protected
    EcsTask(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    EcsTask(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    bind(IRule _rule)
    Allows using tasks as target of EventBridge events.
    bind(IRule _rule, String _id)
    Allows using tasks as target of EventBridge events.
    Deprecated.
    use securityGroups instead.
    The security groups associated with the task.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • EcsTask

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

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

      @Stability(Stable) public EcsTask(@NotNull EcsTaskProps props)
      Parameters:
      props - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule, @Nullable String _id)
      Allows using tasks as target of EventBridge events.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.
      _id -
    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRule _rule)
      Allows using tasks as target of EventBridge events.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      _rule - This parameter is required.
    • getSecurityGroup

      @Stability(Deprecated) @Deprecated @Nullable public ISecurityGroup getSecurityGroup()
      Deprecated.
      use securityGroups instead.
      (deprecated) The security group associated with the task.

      Only applicable with awsvpc network mode.

      Default: - A new security group is created.

    • getSecurityGroups

      @Stability(Stable) @Nullable public List<ISecurityGroup> getSecurityGroups()
      The security groups associated with the task.

      Only applicable with awsvpc network mode.

      Default: - A new security group is created.