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:
IEnvironmentAware,IResource,IExternalTaskDefinition,ITaskDefinition,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:50.517Z")
@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());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IExternalTaskDefinition
IExternalTaskDefinition.Jsii$Default, IExternalTaskDefinition.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
ITaskDefinition.Jsii$Default, ITaskDefinition.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExternalTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedExternalTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) ExternalTaskDefinition(software.constructs.Construct scope, String id) Constructs a new instance of the ExternalTaskDefinition class.ExternalTaskDefinition(software.constructs.Construct scope, String id, ExternalTaskDefinitionProps props) Constructs a new instance of the ExternalTaskDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInferenceAccelerator(InferenceAccelerator _inferenceAccelerator) Overridden method to throw error as interface accelerators are not supported for external tasks.static IExternalTaskDefinitionfromEc2TaskDefinitionArn(software.constructs.Construct scope, String id, String externalTaskDefinitionArn) Imports a task definition from the specified task definition ARN.static IExternalTaskDefinitionfromExternalTaskDefinitionAttributes(software.constructs.Construct scope, String id, ExternalTaskDefinitionAttributes attrs) Imports an existing External task definition from its attributes.Methods inherited from class software.amazon.awscdk.services.ecs.TaskDefinition
addContainer, addExtension, addFirelensLogRouter, addPlacementConstraint, addToExecutionRolePolicy, addToTaskRolePolicy, addVolume, findContainer, findPortMappingByName, fromTaskDefinitionArn, fromTaskDefinitionAttributes, getCompatibility, getContainers, getDefaultContainer, getEphemeralStorageGiB, getExecutionRole, getFamily, getInferenceAccelerators, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getIsManagedInstancesCompatible, getNetworkMode, getPidMode, getReferencesSecretJsonField, getTaskDefinitionArn, getTaskRole, grantRun, obtainExecutionRole, setDefaultContainerMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
getCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getIsManagedInstancesCompatible, getNetworkMode, getTaskDefinitionArn, getTaskRoleMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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) Overridden method to throw error as interface accelerators are not supported for external tasks.- Overrides:
addInferenceAcceleratorin classTaskDefinition- Parameters:
_inferenceAccelerator- This parameter is required.
-