Class PlacementGroupProps.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.PlacementGroupProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<PlacementGroupProps>
Enclosing interface:
PlacementGroupProps

@Stability(Stable) public static final class PlacementGroupProps.Builder extends Object implements software.amazon.jsii.Builder<PlacementGroupProps>
A builder for PlacementGroupProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • partitions

      @Stability(Stable) public PlacementGroupProps.Builder partitions(Number partitions)
      Parameters:
      partitions - The number of partitions. Valid only when Strategy is set to partition.
      Returns:
      this
    • placementGroupName

      @Stability(Stable) public PlacementGroupProps.Builder placementGroupName(String placementGroupName)
      Parameters:
      placementGroupName - the name of this placement group.
      Returns:
      this
    • spreadLevel

      @Stability(Stable) public PlacementGroupProps.Builder spreadLevel(PlacementGroupSpreadLevel spreadLevel)
      Parameters:
      spreadLevel - Places instances on distinct hardware. Spread placement groups are recommended for applications that have a small number of critical instances that should be kept separate from each other. Launching instances in a spread level placement group reduces the risk of simultaneous failures that might occur when instances share the same equipment. Spread level placement groups provide access to distinct hardware, and are therefore suitable for mixing instance types or launching instances over time. If you start or launch an instance in a spread placement group and there is insufficient unique hardware to fulfill the request, the request fails. Amazon EC2 makes more distinct hardware available over time, so you can try your request again later. Placement groups can spread instances across racks or hosts. You can use host level spread placement groups only with AWS Outposts.
      Returns:
      this
    • strategy

      @Stability(Stable) public PlacementGroupProps.Builder strategy(PlacementGroupStrategy strategy)
      Parameters:
      strategy - Which strategy to use when launching instances.
      Returns:
      this
    • build

      @Stability(Stable) public PlacementGroupProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<PlacementGroupProps>
      Returns:
      a new instance of PlacementGroupProps
      Throws:
      NullPointerException - if any required attribute was not provided