Enum ComputeResourceType

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.654Z") @Stability(Experimental) public enum ComputeResourceType extends Enum<ComputeResourceType>
(experimental) Property to specify if the compute environment uses On-Demand, SpotFleet, Fargate, or Fargate Spot compute resources.

Example:

 Vpc vpc = new Vpc(this, "VPC");
 ComputeEnvironment spotEnvironment = ComputeEnvironment.Builder.create(this, "MySpotEnvironment")
         .computeResources(ComputeResources.builder()
                 .type(ComputeResourceType.SPOT)
                 .bidPercentage(75) // Bids for resources at 75% of the on-demand price
                 .vpc(vpc)
                 .build())
         .build();
 
  • Enum Constant Details

    • ON_DEMAND

      @Stability(Experimental) public static final ComputeResourceType ON_DEMAND
      (experimental) Resources will be EC2 On-Demand resources.
    • SPOT

      @Stability(Experimental) public static final ComputeResourceType SPOT
      (experimental) Resources will be EC2 SpotFleet resources.
    • FARGATE

      @Stability(Experimental) public static final ComputeResourceType FARGATE
      (experimental) Resources will be Fargate resources.
    • FARGATE_SPOT

      @Stability(Experimental) public static final ComputeResourceType FARGATE_SPOT
      (experimental) Resources will be Fargate Spot resources.

      Fargate Spot uses spare capacity in the AWS cloud to run your fault-tolerant, time-flexible jobs at up to a 70% discount. If AWS needs the resources back, jobs running on Fargate Spot will be interrupted with two minutes of notification.

  • Method Details

    • values

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