AWS SDK Version 4 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the CreatePlacementGroup operation. 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.

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

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.EC2.AmazonEC2Request
      Amazon.EC2.Model.CreatePlacementGroupRequest

Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z

Syntax

C#
public class CreatePlacementGroupRequest : AmazonEC2Request
         IAmazonWebServiceRequest

The CreatePlacementGroupRequest type exposes the following members

Constructors

NameDescription
Public Method CreatePlacementGroupRequest()

Empty constructor used to set properties independently even when a simple constructor is available

Public Method CreatePlacementGroupRequest(string, PlacementStrategy)

Instantiates CreatePlacementGroupRequest with the parameterized properties

Properties

NameTypeDescription
Public Property DryRun System.Nullable<System.Boolean>

Gets and sets the property DryRun.

Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Public Property GroupName System.String

Gets and sets the property GroupName.

A name for the placement group. Must be unique within the scope of your account for the Region.

Constraints: Up to 255 ASCII characters

Public Property PartitionCount System.Nullable<System.Int32>

Gets and sets the property PartitionCount.

The number of partitions. Valid only when Strategy is set to partition.

Public Property SpreadLevel Amazon.EC2.SpreadLevel

Gets and sets the property SpreadLevel.

Determines how placement groups spread instances.

  • Host – You can use host only with Outpost placement groups.

  • Rack – No usage restrictions.

Public Property Strategy Amazon.EC2.PlacementStrategy

Gets and sets the property Strategy.

The placement strategy.

Public Property TagSpecifications System.Collections.Generic.List<Amazon.EC2.Model.TagSpecification>

Gets and sets the property TagSpecifications.

The tags to apply to the new placement group.

Starting with version 4 of the SDK this property will default to null. If no data for this property is returned from the service the property will also be null. This was changed to improve performance and allow the SDK and caller to distinguish between a property not set or a property being empty to clear out a value. To retain the previous SDK behavior set the AWSConfigs.InitializeCollections static property to true.

Examples

This example creates a placement group with the specified name.

To create a placement group


var client = new AmazonEC2Client();
var response = client.CreatePlacementGroup(new CreatePlacementGroupRequest 
{
    GroupName = "my-cluster",
    Strategy = "cluster"
});


            

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.7.2 and newer