Enum CapacityDistributionStrategy

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

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-24T11:33:09.302Z") @Stability(Stable) public enum CapacityDistributionStrategy extends Enum<CapacityDistributionStrategy>
The strategies for when launches fail in an Availability Zone.

Example:

 Vpc vpc;
 InstanceType instanceType;
 IMachineImage machineImage;
 AutoScalingGroup.Builder.create(this, "ASG")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(machineImage)
         // ...
         .azCapacityDistributionStrategy(CapacityDistributionStrategy.BALANCED_ONLY)
         .build();
 
  • Enum Constant Details

    • BALANCED_ONLY

      @Stability(Stable) public static final CapacityDistributionStrategy BALANCED_ONLY
      If launches fail in an Availability Zone, Auto Scaling will continue to attempt to launch in the unhealthy zone to preserve a balanced distribution.
    • BALANCED_BEST_EFFORT

      @Stability(Stable) public static final CapacityDistributionStrategy BALANCED_BEST_EFFORT
      If launches fail in an Availability Zone, Auto Scaling will attempt to launch in another healthy Availability Zone instead.
  • Method Details

    • values

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