@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.705Z") @Stability(value=Stable) 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. |
software.amazon.jsii.JsiiObject.InitializationModeIFargateTaskDefinition.Jsii$Default, IFargateTaskDefinition.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
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.
|
protected |
FargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
FargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
static 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.
|
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, grantRun, obtainExecutionRole, setDefaultContainerapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetCompatibility, getExecutionRole, getIsEc2Compatible, getIsExternalCompatible, getIsFargateCompatible, getTaskDefinitionArn, getTaskRoleapplyRemovalPolicy, getEnv, getStackprotected FargateTaskDefinition(software.amazon.jsii.JsiiObjectRef objRef)
protected FargateTaskDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public FargateTaskDefinition(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
FargateTaskDefinitionProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Stable)
public FargateTaskDefinition(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Stable) @NotNull public static IFargateTaskDefinition fromFargateTaskDefinitionArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String fargateTaskDefinitionArn)
scope - This parameter is required.id - This parameter is required.fargateTaskDefinitionArn - This parameter is required.@Stability(value=Stable) @NotNull public static IFargateTaskDefinition fromFargateTaskDefinitionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FargateTaskDefinitionAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Stable) @NotNull public NetworkMode getNetworkMode()
Fargate tasks require the awsvpc network mode.
getNetworkMode in interface ITaskDefinitiongetNetworkMode in class TaskDefinition@Stability(value=Stable) @Nullable public Number getEphemeralStorageGiB()
getEphemeralStorageGiB in class TaskDefinitionCopyright © 2022. All rights reserved.