Class FargateTaskDefinition
The details of a task definition run on a Fargate cluster.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class FargateTaskDefinition : TaskDefinition, IFargateTaskDefinition, ITaskDefinition, IResource, IConstruct, IDependable
Syntax (vb)
Public Class FargateTaskDefinition
Inherits TaskDefinition
Implements IFargateTaskDefinition, ITaskDefinition, IResource, IConstruct, IDependable
Remarks
Resource: AWS::ECS::TaskDefinition
ExampleMetadata: infused
Examples
var fargateTaskDefinition = new FargateTaskDefinition(this, "TaskDef", new FargateTaskDefinitionProps {
MemoryLimitMiB = 512,
Cpu = 256
});
var container = fargateTaskDefinition.AddContainer("WebContainer", new ContainerDefinitionOptions {
// Use an image from DockerHub
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample")
});
Synopsis
Constructors
FargateTaskDefinition(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
FargateTaskDefinition(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
FargateTaskDefinition(Construct, String, IFargateTaskDefinitionProps) | Constructs a new instance of the FargateTaskDefinition class. |
Properties
EphemeralStorageGiB | The amount (in GiB) of ephemeral storage to be allocated to the task. |
NetworkMode | The Docker networking mode to use for the containers in the task. |
Methods
FromFargateTaskDefinitionArn(Construct, String, String) | Imports a task definition from the specified task definition ARN. |
FromFargateTaskDefinitionAttributes(Construct, String, IFargateTaskDefinitionAttributes) | Import an existing Fargate task definition from its attributes. |
Constructors
FargateTaskDefinition(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected FargateTaskDefinition(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
FargateTaskDefinition(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected FargateTaskDefinition(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
FargateTaskDefinition(Construct, String, IFargateTaskDefinitionProps)
Constructs a new instance of the FargateTaskDefinition class.
public FargateTaskDefinition(Construct scope, string id, IFargateTaskDefinitionProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IFargateTaskDefinitionProps
Properties
EphemeralStorageGiB
The amount (in GiB) of ephemeral storage to be allocated to the task.
public override Nullable<double> EphemeralStorageGiB { get; }
Property Value
System.Nullable<System.Double>
Overrides
NetworkMode
The Docker networking mode to use for the containers in the task.
public override NetworkMode NetworkMode { get; }
Property Value
Overrides
Remarks
Fargate tasks require the awsvpc network mode.
Methods
FromFargateTaskDefinitionArn(Construct, String, String)
Imports a task definition from the specified task definition ARN.
public static IFargateTaskDefinition FromFargateTaskDefinitionArn(Construct scope, string id, string fargateTaskDefinitionArn)
Parameters
- scope Constructs.Construct
- id System.String
- fargateTaskDefinitionArn System.String
Returns
FromFargateTaskDefinitionAttributes(Construct, String, IFargateTaskDefinitionAttributes)
Import an existing Fargate task definition from its attributes.
public static IFargateTaskDefinition FromFargateTaskDefinitionAttributes(Construct scope, string id, IFargateTaskDefinitionAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IFargateTaskDefinitionAttributes
Returns