Class Compatibility
The task launch type compatibility requirement.
Inheritance
System.Object
Compatibility
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.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, "Ec2Cluster", new ClusterProps { Vpc = vpc });
cluster.AddCapacity("DefaultAutoScalingGroup", new AddCapacityOptions {
InstanceType = new InstanceType("t2.micro"),
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC }
});
var taskDefinition = new TaskDefinition(this, "TD", new TaskDefinitionProps {
Compatibility = Compatibility.EC2
});
taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("foo/bar"),
MemoryLimitMiB = 256
});
var runTask = new EcsRunTask(this, "Run", new EcsRunTaskProps {
IntegrationPattern = IntegrationPattern.RUN_JOB,
Cluster = cluster,
TaskDefinition = taskDefinition,
LaunchTarget = new EcsEc2LaunchTarget(new EcsEc2LaunchTargetOptions {
PlacementStrategies = new [] { PlacementStrategy.SpreadAcrossInstances(), PlacementStrategy.PackedByCpu(), PlacementStrategy.Randomly() },
PlacementConstraints = new [] { PlacementConstraint.MemberOf("blieptuut") }
})
});
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 |