enum Compatibility
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.Compatibility |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#Compatibility |
Java | software.amazon.awscdk.services.ecs.Compatibility |
Python | aws_cdk.aws_ecs.Compatibility |
TypeScript (source) | aws-cdk-lib » aws_ecs » Compatibility |
The task launch type compatibility requirement.
Example
const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
isDefault: true,
});
const cluster = new ecs.Cluster(this, 'FargateCluster', { vpc });
const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
memoryMiB: '512',
cpu: '256',
compatibility: ecs.Compatibility.FARGATE,
});
const containerDefinition = taskDefinition.addContainer('TheContainer', {
image: ecs.ContainerImage.fromRegistry('foo/bar'),
memoryLimitMiB: 256,
});
const runTask = new tasks.EcsRunTask(this, 'RunFargate', {
integrationPattern: sfn.IntegrationPattern.RUN_JOB,
cluster,
taskDefinition,
assignPublicIp: true,
containerOverrides: [{
containerDefinition,
environment: [{ name: 'SOME_KEY', value: sfn.JsonPath.stringAt('$.SomeKey') }],
}],
launchTarget: new tasks.EcsFargateLaunchTarget(),
propagatedTagSource: ecs.PropagatedTagSource.TASK_DEFINITION,
});
Members
| Name | Description |
|---|---|
| EC2 | The task should specify the EC2 launch type. |
| FARGATE | The task should specify the Fargate 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. |
| MANAGED_INSTANCES | The task should specify the Managed Instances launch type. |
| EC2_AND_MANAGED_INSTANCES | The task can specify either the EC2 or Managed Instances launch types. |
| FARGATE_AND_MANAGED_INSTANCES | The task can specify either the Fargate or Managed Instances launch types. |
| FARGATE_AND_EC2_AND_MANAGED_INSTANCES | The task can specify either the Fargate, EC2 or Managed Instances launch types. |
EC2
The task should specify the EC2 launch type.
FARGATE
The task should specify the Fargate 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.
MANAGED_INSTANCES
The task should specify the Managed Instances launch type.
EC2_AND_MANAGED_INSTANCES
The task can specify either the EC2 or Managed Instances launch types.
FARGATE_AND_MANAGED_INSTANCES
The task can specify either the Fargate or Managed Instances launch types.
FARGATE_AND_EC2_AND_MANAGED_INSTANCES
The task can specify either the Fargate, EC2 or Managed Instances launch types.

.NET
Go
Java
Python
TypeScript (