Class ExternalTaskDefinition

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ecs.TaskDefinition
software.amazon.awscdk.services.ecs.ExternalTaskDefinition
All Implemented Interfaces:
IResource, IExternalTaskDefinition, ITaskDefinition, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:06.564Z") @Stability(Stable) public class ExternalTaskDefinition extends TaskDefinition implements IExternalTaskDefinition
The details of a task definition run on an External cluster.

Example:

 ExternalTaskDefinition externalTaskDefinition = new ExternalTaskDefinition(this, "TaskDef");
 ContainerDefinition container = externalTaskDefinition.addContainer("WebContainer", ContainerDefinitionOptions.builder()
         // Use an image from DockerHub
         .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
         .memoryLimitMiB(1024)
         .build());
 
  • Constructor Details

    • ExternalTaskDefinition

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

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

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

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

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

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

    • fromEc2TaskDefinitionArn

      @Stability(Stable) @NotNull public static IExternalTaskDefinition fromEc2TaskDefinitionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String externalTaskDefinitionArn)
      Imports a task definition from the specified task definition ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      externalTaskDefinitionArn - This parameter is required.
    • fromExternalTaskDefinitionAttributes

      @Stability(Stable) @NotNull public static IExternalTaskDefinition fromExternalTaskDefinitionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ExternalTaskDefinitionAttributes attrs)
      Imports an existing External task definition from its attributes.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • addInferenceAccelerator

      @Stability(Stable) public void addInferenceAccelerator(@NotNull InferenceAccelerator _inferenceAccelerator)
      Overriden method to throw error as interface accelerators are not supported for external tasks.

      Overrides:
      addInferenceAccelerator in class TaskDefinition
      Parameters:
      _inferenceAccelerator - This parameter is required.