Class FargateTaskDefinition
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.ecs.TaskDefinition
software.amazon.awscdk.services.ecs.FargateTaskDefinition
- All Implemented Interfaces:
IConstruct,IDependable,IResource,IFargateTaskDefinition,ITaskDefinition,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:47.347Z")
@Stability(Stable)
public class FargateTaskDefinition
extends TaskDefinition
implements IFargateTaskDefinition
The details of a task definition run on a Fargate cluster.
Example:
FargateTaskDefinition fargateTaskDefinition = FargateTaskDefinition.Builder.create(this, "TaskDef")
.memoryLimitMiB(512)
.cpu(256)
.build();
ContainerDefinition container = fargateTaskDefinition.addContainer("WebContainer", ContainerDefinitionOptions.builder()
// Use an image from DockerHub
.image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
.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.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IFargateTaskDefinition
IFargateTaskDefinition.Jsii$Default, IFargateTaskDefinition.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
ITaskDefinition.Jsii$Default, ITaskDefinition.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) FargateTaskDefinition(software.constructs.Construct scope, String id) Constructs a new instance of the FargateTaskDefinition class.FargateTaskDefinition(software.constructs.Construct scope, String id, FargateTaskDefinitionProps props) Constructs a new instance of the FargateTaskDefinition class. -
Method Summary
Modifier and TypeMethodDescriptionstatic IFargateTaskDefinitionfromFargateTaskDefinitionArn(software.constructs.Construct scope, String id, String fargateTaskDefinitionArn) Imports a task definition from the specified task definition ARN.static IFargateTaskDefinitionfromFargateTaskDefinitionAttributes(software.constructs.Construct scope, String id, FargateTaskDefinitionAttributes attrs) Import an existing Fargate task definition from its attributes.The amount (in GiB) of ephemeral storage to be allocated to the task.The Docker networking mode to use for the containers in the task.Methods inherited from class software.amazon.awscdk.services.ecs.TaskDefinition
addContainer, addExtension, addFirelensLogRouter, addInferenceAccelerator, addPlacementConstraint, addToExecutionRolePolicy, addToTaskRolePolicy, addVolume, findContainer, fromTaskDefinitionArn, fromTaskDefinitionAttributes, getCompatibility, getContainers, getDefaultContainer, getExecutionRole, getFamily, getInferenceAccelerators, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getReferencesSecretJsonField, getTaskDefinitionArn, getTaskRole, obtainExecutionRole, setDefaultContainer, validateMethods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourceMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesizeMethods inherited from class software.constructs.Construct
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.amazon.awscdk.core.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
getCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getTaskDefinitionArn, getTaskRoleMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FargateTaskDefinition
protected FargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
FargateTaskDefinition
protected FargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
FargateTaskDefinition
@Stability(Stable) public FargateTaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable FargateTaskDefinitionProps props) Constructs a new instance of the FargateTaskDefinition class.- Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
FargateTaskDefinition
@Stability(Stable) public FargateTaskDefinition(@NotNull software.constructs.Construct scope, @NotNull String id) Constructs a new instance of the FargateTaskDefinition class.- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromFargateTaskDefinitionArn
@Stability(Stable) @NotNull public static IFargateTaskDefinition fromFargateTaskDefinitionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String fargateTaskDefinitionArn) Imports a task definition from the specified task definition ARN.- Parameters:
scope- This parameter is required.id- This parameter is required.fargateTaskDefinitionArn- This parameter is required.
-
fromFargateTaskDefinitionAttributes
@Stability(Stable) @NotNull public static IFargateTaskDefinition fromFargateTaskDefinitionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FargateTaskDefinitionAttributes attrs) Import an existing Fargate task definition from its attributes.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
getNetworkMode
The Docker networking mode to use for the containers in the task.Fargate tasks require the awsvpc network mode.
- Specified by:
getNetworkModein interfaceITaskDefinition- Overrides:
getNetworkModein classTaskDefinition
-
getEphemeralStorageGiB
The amount (in GiB) of ephemeral storage to be allocated to the task.- Overrides:
getEphemeralStorageGiBin classTaskDefinition
-