AWS::EC2::PlacementGroup - AWS CloudFormation


Specifies 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.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::EC2::PlacementGroup", "Properties" : { "SpreadLevel" : String, "Strategy" : String } }


Type: AWS::EC2::PlacementGroup Properties: SpreadLevel: String Strategy: String



The spread level for the placement group. Only Outpost placement groups can be spread across hosts.

Required: No

Type: String

Allowed values: host | rack

Update requires: Replacement


The placement strategy.

Required: No

Type: String

Allowed values: cluster | partition | spread

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the name of the placement group.

For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The name of the placement group.


Create a placement group

The following example declares a placement group with a cluster placement strategy.


"PlacementGroup" : { "Type" : "AWS::EC2::PlacementGroup", "Properties" : { "Strategy" : "cluster" } }


PlacementGroup: Type: AWS::EC2::PlacementGroup Properties: Strategy: cluster