@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.677Z") @Stability(value=Stable) public enum Compatibility extends Enum<Compatibility>
Example:
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
.isDefault(true)
.build());
Cluster cluster = Cluster.Builder.create(this, "Ec2Cluster").vpc(vpc).build();
cluster.addCapacity("DefaultAutoScalingGroup", AddCapacityOptions.builder()
.instanceType(new InstanceType("t2.micro"))
.vpcSubnets(SubnetSelection.builder().subnetType(SubnetType.PUBLIC).build())
.build());
TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
.compatibility(Compatibility.EC2)
.build();
taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
.image(ContainerImage.fromRegistry("foo/bar"))
.memoryLimitMiB(256)
.build());
EcsRunTask runTask = EcsRunTask.Builder.create(this, "Run")
.integrationPattern(IntegrationPattern.RUN_JOB)
.cluster(cluster)
.taskDefinition(taskDefinition)
.launchTarget(EcsEc2LaunchTarget.Builder.create()
.placementStrategies(List.of(PlacementStrategy.spreadAcrossInstances(), PlacementStrategy.packedByCpu(), PlacementStrategy.randomly()))
.placementConstraints(List.of(PlacementConstraint.memberOf("blieptuut")))
.build())
.build();
| Enum Constant and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
static Compatibility |
valueOf(String name)
Returns 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.
|
@Stability(value=Stable) public static final Compatibility EC2
@Stability(value=Stable) public static final Compatibility FARGATE
@Stability(value=Stable) public static final Compatibility EC2_AND_FARGATE
@Stability(value=Stable) public static final Compatibility EXTERNAL
public static Compatibility[] values()
for (Compatibility c : Compatibility.values()) System.out.println(c);
public static Compatibility valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2022. All rights reserved.