createPlacementGroup

abstract suspend fun createPlacementGroup(input: CreatePlacementGroupRequest = CreatePlacementGroupRequest { }): CreatePlacementGroupResponse

Creates a placement group in which to launch instances. The strategy of the placement group determines how the instances are organized within the group.

A cluster placement group is a logical grouping of instances within a single Availability Zone that benefit from low network latency, high network throughput. A spread placement group places instances on distinct hardware. A partition placement group places groups of instances in different partitions, where instances in one partition do not share the same hardware with instances in another partition. A precision-time placement group places instances on supported hardware with direct access to high-precision time sources in AWS infrastructure.

For more information, see Placement groups in the Amazon EC2 User Guide.

Samples

// This example creates a placement group with the specified name.
val resp = ec2Client.createPlacementGroup {
    groupName = "my-cluster"
    strategy = PlacementStrategy.fromValue("cluster")
}