Class PlacementGroup
Defines a placement group.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class PlacementGroup : Resource, IPlacementGroup, IResource
Syntax (vb)
Public Class PlacementGroup
Inherits Resource
Implements IPlacementGroup, IResource
Remarks
Placement groups give you fine-grained control over where your instances are provisioned.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var placementGroup = new PlacementGroup(this, "MyPlacementGroup", new PlacementGroupProps {
Partitions = 123,
PlacementGroupName = "placementGroupName",
SpreadLevel = PlacementGroupSpreadLevel.HOST,
Strategy = PlacementGroupStrategy.CLUSTER
});
Synopsis
Constructors
PlacementGroup(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
PlacementGroup(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
PlacementGroup(Construct, String, IPlacementGroupProps) |
Properties
Partitions | The number of partitions. |
PlacementGroupName | The name of this placement group. |
SpreadLevel | Places instances on distinct hardware. |
Strategy | Which strategy to use when launching instances. |
Methods
FromPlacementGroupName(Construct, String, String) | Import a PlacementGroup by its arn. |
Constructors
PlacementGroup(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected PlacementGroup(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
PlacementGroup(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected PlacementGroup(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
PlacementGroup(Construct, String, IPlacementGroupProps)
public PlacementGroup(Construct scope, string id, IPlacementGroupProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IPlacementGroupProps
Properties
Partitions
The number of partitions.
public virtual Nullable<double> Partitions { get; }
Property Value
System.Nullable<System.Double>
Remarks
Valid only when Strategy is set to PARTITION.
PlacementGroupName
The name of this placement group.
public virtual string PlacementGroupName { get; }
Property Value
System.String
SpreadLevel
Places instances on distinct hardware.
public virtual Nullable<PlacementGroupSpreadLevel> SpreadLevel { get; }
Property Value
System.Nullable<PlacementGroupSpreadLevel>
Remarks
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.
Strategy
Which strategy to use when launching instances.
public virtual Nullable<PlacementGroupStrategy> Strategy { get; }
Property Value
System.Nullable<PlacementGroupStrategy>
Methods
FromPlacementGroupName(Construct, String, String)
Import a PlacementGroup by its arn.
public static IPlacementGroup FromPlacementGroupName(Construct scope, string id, string placementGroupName)
Parameters
- scope Constructs.Construct
- id System.String
- placementGroupName System.String
Returns