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 classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.IFargateTaskDefinition
IFargateTaskDefinition.Jsii$Default, IFargateTaskDefinition.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
ITaskDefinition.Jsii$Default, ITaskDefinition.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
FargateTaskDefinition
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
FargateTaskDefinition
(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 IFargateTaskDefinition
fromFargateTaskDefinitionArn
(software.constructs.Construct scope, String id, String fargateTaskDefinitionArn) Imports a task definition from the specified task definition ARN.static IFargateTaskDefinition
fromFargateTaskDefinitionAttributes
(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, validate
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
Methods inherited from class software.constructs.Construct
toString
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, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.awscdk.services.ecs.ITaskDefinition
getCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getTaskDefinitionArn, getTaskRole
Methods 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:
getNetworkMode
in interfaceITaskDefinition
- Overrides:
getNetworkMode
in classTaskDefinition
-
getEphemeralStorageGiB
The amount (in GiB) of ephemeral storage to be allocated to the task.- Overrides:
getEphemeralStorageGiB
in classTaskDefinition
-