Class Compatibility
The task launch type compatibility requirement.
Inheritance
System.Object
Compatibility
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class Compatibility : Enum
Syntax (vb)
Public NotInheritable Class Compatibility
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
var vpc = Vpc.FromLookup(this, "Vpc", new VpcLookupOptions {
IsDefault = true
});
var cluster = new Cluster(this, "FargateCluster", new ClusterProps { Vpc = vpc });
var taskDefinition = new TaskDefinition(this, "TD", new TaskDefinitionProps {
MemoryMiB = "512",
Cpu = "256",
Compatibility = Compatibility.FARGATE
});
var containerDefinition = taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("foo/bar"),
MemoryLimitMiB = 256
});
var runTask = new EcsRunTask(this, "RunFargate", new EcsRunTaskProps {
IntegrationPattern = IntegrationPattern.RUN_JOB,
Cluster = cluster,
TaskDefinition = taskDefinition,
AssignPublicIp = true,
ContainerOverrides = new [] { new ContainerOverride {
ContainerDefinition = containerDefinition,
Environment = new [] { new TaskEnvironmentVariable { Name = "SOME_KEY", Value = JsonPath.StringAt("$.SomeKey") } }
} },
LaunchTarget = new EcsFargateLaunchTarget(),
PropagatedTagSource = PropagatedTagSource.TASK_DEFINITION
});
Synopsis
Fields
EC2 | The task should specify the EC2 launch type. |
EC2_AND_FARGATE | The task can specify either the EC2 or Fargate launch types. |
EXTERNAL | The task should specify the External launch type. |
FARGATE | The task should specify the Fargate launch type. |
value__ |
Fields
EC2
The task should specify the EC2 launch type.
public const Compatibility EC2
Field Value
Type | Description |
---|---|
Compatibility |
EC2_AND_FARGATE
The task can specify either the EC2 or Fargate launch types.
public const Compatibility EC2_AND_FARGATE
Field Value
Type | Description |
---|---|
Compatibility |
EXTERNAL
The task should specify the External launch type.
public const Compatibility EXTERNAL
Field Value
Type | Description |
---|---|
Compatibility |
FARGATE
The task should specify the Fargate launch type.
public const Compatibility FARGATE
Field Value
Type | Description |
---|---|
Compatibility |
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |