Enum Compatibility
- All Implemented Interfaces:
Serializable,Comparable<Compatibility>,java.lang.constant.Constable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:39.146Z")
@Stability(Stable)
public enum Compatibility
extends Enum<Compatibility>
The task launch type compatibility requirement.
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build();
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.memoryMiB("512")
.cpu("256")
.compatibility(Compatibility.FARGATE)
.build();
ContainerDefinition containerDefinition = taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("foo/bar"))
.memoryLimitMiB(256)
.build());
EcsRunTask runTask = EcsRunTask.Builder.create(this, "RunFargate")
.integrationPattern(IntegrationPattern.RUN_JOB)
.cluster(cluster)
.taskDefinition(taskDefinition)
.assignPublicIp(true)
.containerOverrides(List.of(ContainerOverride.builder()
.containerDefinition(containerDefinition)
.environment(List.of(TaskEnvironmentVariable.builder().name("SOME_KEY").value(JsonPath.stringAt("$.SomeKey")).build()))
.build()))
.launchTarget(new EcsFargateLaunchTarget())
.propagatedTagSource(PropagatedTagSource.TASK_DEFINITION)
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe task should specify the EC2 launch type.The task can specify either the EC2 or Fargate launch types.The task can specify either the EC2 or Managed Instances launch types.The task should specify the External launch type.The task should specify the Fargate launch type.The task can specify either the Fargate, EC2 or Managed Instances launch types.The task can specify either the Fargate or Managed Instances launch types.The task should specify the Managed Instances launch type. -
Method Summary
Modifier and TypeMethodDescriptionstatic CompatibilityReturns the enum constant of this type with the specified name.static Compatibility[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
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.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-