Enum Compatibility

java.lang.Object
java.lang.Enum<Compatibility>
software.amazon.awscdk.services.ecs.Compatibility
All Implemented Interfaces:
Serializable, Comparable<Compatibility>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:01.052Z") @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();
 
  • Enum Constant Details

    • EC2

      @Stability(Stable) public static final Compatibility EC2
      The task should specify the EC2 launch type.
    • FARGATE

      @Stability(Stable) public static final Compatibility FARGATE
      The task should specify the Fargate launch type.
    • EC2_AND_FARGATE

      @Stability(Stable) public static final Compatibility EC2_AND_FARGATE
      The task can specify either the EC2 or Fargate launch types.
    • EXTERNAL

      @Stability(Stable) public static final Compatibility EXTERNAL
      The task should specify the External launch type.
  • Method Details

    • values

      public static Compatibility[] 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

      public static Compatibility valueOf(String name)
      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 name
      NullPointerException - if the argument is null