@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-13T01:13:38.836Z") public enum Compatibility extends java.lang.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(java.lang.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.
|
public static final Compatibility EC2
public static final Compatibility FARGATE
public static final Compatibility EC2_AND_FARGATE
public static final Compatibility EXTERNAL
public static Compatibility[] values()
for (Compatibility c : Compatibility.values()) System.out.println(c);
public static Compatibility valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null