@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:37:00.358Z") public class FargateTaskDefinition extends TaskDefinition implements IFargateTaskDefinition
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());
Modifier and Type | Class and Description |
---|---|
static class |
FargateTaskDefinition.Builder
A fluent builder for
FargateTaskDefinition . |
IFargateTaskDefinition.Jsii$Default, IFargateTaskDefinition.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
FargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
FargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) |
|
FargateTaskDefinition(software.constructs.Construct scope,
java.lang.String id)
Constructs a new instance of the FargateTaskDefinition class.
|
|
FargateTaskDefinition(software.constructs.Construct scope,
java.lang.String id,
FargateTaskDefinitionProps props)
Constructs a new instance of the FargateTaskDefinition class.
|
Modifier and Type | Method and Description |
---|---|
static IFargateTaskDefinition |
fromFargateTaskDefinitionArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String fargateTaskDefinitionArn)
Imports a task definition from the specified task definition ARN.
|
static IFargateTaskDefinition |
fromFargateTaskDefinitionAttributes(software.constructs.Construct scope,
java.lang.String id,
FargateTaskDefinitionAttributes attrs)
Import an existing Fargate task definition from its attributes.
|
java.lang.Number |
getEphemeralStorageGiB()
The amount (in GiB) of ephemeral storage to be allocated to the task.
|
NetworkMode |
getNetworkMode()
The Docker networking mode to use for the containers in the task.
|
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
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getTaskDefinitionArn, getTaskRole
applyRemovalPolicy, getEnv, getStack
getNode
protected FargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef)
protected FargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public FargateTaskDefinition(software.constructs.Construct scope, java.lang.String id, FargateTaskDefinitionProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public FargateTaskDefinition(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IFargateTaskDefinition fromFargateTaskDefinitionArn(software.constructs.Construct scope, java.lang.String id, java.lang.String fargateTaskDefinitionArn)
scope
- This parameter is required.id
- This parameter is required.fargateTaskDefinitionArn
- This parameter is required.public static IFargateTaskDefinition fromFargateTaskDefinitionAttributes(software.constructs.Construct scope, java.lang.String id, FargateTaskDefinitionAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public NetworkMode getNetworkMode()
Fargate tasks require the awsvpc network mode.
getNetworkMode
in interface ITaskDefinition
getNetworkMode
in class TaskDefinition
public java.lang.Number getEphemeralStorageGiB()
getEphemeralStorageGiB
in class TaskDefinition