Enum PlacementGroupStrategy

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:00.997Z") @Stability(Stable) public enum PlacementGroupStrategy extends Enum<PlacementGroupStrategy>
Which strategy to use when launching instances.

Example:

 InstanceType instanceType;
 PlacementGroup pg = PlacementGroup.Builder.create(this, "test-pg")
         .strategy(PlacementGroupStrategy.SPREAD)
         .build();
 Instance.Builder.create(this, "Instance")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(MachineImage.latestAmazonLinux2023())
         .placementGroup(pg)
         .build();
 
  • Enum Constant Details

    • CLUSTER

      @Stability(Stable) public static final PlacementGroupStrategy CLUSTER
      Packs instances close together inside an Availability Zone.

      This strategy enables workloads to achieve the low-latency network performance necessary for tightly-coupled node-to-node communication that is typical of high-performance computing (HPC) applications.

    • PARTITION

      @Stability(Stable) public static final PlacementGroupStrategy PARTITION
      Spreads your instances across logical partitions such that groups of instances in one partition do not share the underlying hardware with groups of instances in different partitions.

      This strategy is typically used by large distributed and replicated workloads, such as Hadoop, Cassandra, and Kafka.

    • SPREAD

      @Stability(Stable) public static final PlacementGroupStrategy SPREAD
      Strictly places a small group of instances across distinct underlying hardware to reduce correlated failures.
  • Method Details

    • values

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