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.103.1 (build bef2dea)", date="2024-10-25T14:21:15.666Z") @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.ecs.*;
 import software.amazon.awscdk.services.ec2.*;
 ICluster cluster;
 TaskDefinition taskDefinition;
 Rule rule = Rule.Builder.create(this, "Rule")
         .schedule(Schedule.rate(Duration.hours(1)))
         .build();
 rule.addTarget(
 EcsTask.Builder.create()
         .cluster(cluster)
         .taskDefinition(taskDefinition)
         .assignPublicIp(true)
         .subnetSelection(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
         .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.
    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.
    • 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.