@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-04T15:39:07.352Z") @Stability(value=Experimental) public enum Compatibility extends Enum<Compatibility>
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())
.build();
| Enum Constant and Description |
|---|
EC2
(experimental) The task should specify the EC2 launch type.
|
EC2_AND_FARGATE
(experimental) The task can specify either the EC2 or Fargate launch types.
|
EXTERNAL
(experimental) The task should specify the External launch type.
|
FARGATE
(experimental) 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=Experimental) public static final Compatibility EC2
@Stability(value=Experimental) public static final Compatibility FARGATE
@Stability(value=Experimental) public static final Compatibility EC2_AND_FARGATE
@Stability(value=Experimental) 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.