Skip to main content

placement_groups

Creates, updates, deletes, gets or lists a placement_groups resource.

Overview

Nameplacement_groups
TypeResource
Idaws.ec2.placement_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
group_arnstringThe Amazon Resource Name (ARN) of the placement group.
group_idstringThe ID of the placement group.
group_namestringThe name of the placement group.
linked_group_idstringReserved for future use.
operatorstringThe service provider that manages the Placement Group.
parent_group_idstringThe ID of the parent placement group.
partition_countintegerThe number of partitions. Valid only if strategy is set to partition.
spread_levelstringThe spread level for the placement group. Only Outpost placement groups can be spread across hosts.
statestringThe state of the placement group.
strategystringThe placement strategy.
tagsstringAny tags applied to the placement group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_placement_groupsselectregionGroupId, DryRun, GroupName, FilterDescribes the specified placement groups or all of your placement groups. To describe a specific placement group that is shared with your account, you must specify the ID of the placement group using the GroupId parameter. Specifying the name of a shared placement group using the GroupNames parameter will result in an error. For more information, see Placement groups in the Amazon EC2 User Guide.
create_placement_groupinsertregionPartitionCount, TagSpecification, SpreadLevel, LinkedGroupId, Operator, ParentGroupId, DryRun, GroupName, StrategyCreates 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 Amazon Web Services infrastructure. For more information, see Placement groups in the Amazon EC2 User Guide.
delete_placement_groupdeleteGroupName, regionDryRunDeletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. You cannot delete a placement group that is a parent of a cluster placement group. Delete the cluster placement groups first. For more information, see Placement groups in the Amazon EC2 User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
GroupNamestringThe name of the placement group.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks 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.
FilterarrayThe filters. group-name - The name of the placement group. group-arn - The Amazon Resource Name (ARN) of the placement group. spread-level - The spread level for the placement group (host | rack). state - The state of the placement group (pending | available | deleting | deleted). strategy - The strategy of the placement group (cluster | spread | partition | precision-time). tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.
GroupIdarrayThe IDs of the placement groups.
GroupNamestringA name for the placement group. Must be unique within the scope of your account for the Region. Constraints: Up to 255 ASCII characters
LinkedGroupIdstringReserved for future use.
OperatorobjectReserved for internal use.
ParentGroupIdstringThe ID of a parent placement group. Valid only when Strategy is set to cluster.
PartitionCountintegerThe number of partitions. Valid only when Strategy is set to partition.
SpreadLevelstringDetermines how placement groups spread instances. Host – You can use host only with Outpost placement groups. Rack – No usage restrictions.
StrategystringThe placement strategy.
TagSpecificationarrayThe tags to apply to the new placement group.

SELECT examples

Describes the specified placement groups or all of your placement groups. To describe a specific placement group that is shared with your account, you must specify the ID of the placement group using the GroupId parameter. Specifying the name of a shared placement group using the GroupNames parameter will result in an error. For more information, see Placement groups in the Amazon EC2 User Guide.

SELECT
group_arn,
group_id,
group_name,
linked_group_id,
operator,
parent_group_id,
partition_count,
spread_level,
state,
strategy,
tags
FROM aws.ec2.placement_groups
WHERE region = '{{ region }}' -- required
AND GroupId = '{{ GroupId }}'
AND DryRun = '{{ DryRun }}'
AND GroupName = '{{ GroupName }}'
AND Filter = '{{ Filter }}'
;

INSERT examples

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 Amazon Web Services infrastructure. For more information, see Placement groups in the Amazon EC2 User Guide.

INSERT INTO aws.ec2.placement_groups (
region,
PartitionCount,
TagSpecification,
SpreadLevel,
LinkedGroupId,
Operator,
ParentGroupId,
DryRun,
GroupName,
Strategy
)
SELECT
'{{ region }}',
'{{ PartitionCount }}',
'{{ TagSpecification }}',
'{{ SpreadLevel }}',
'{{ LinkedGroupId }}',
'{{ Operator }}',
'{{ ParentGroupId }}',
'{{ DryRun }}',
'{{ GroupName }}',
'{{ Strategy }}'
RETURNING
group_arn,
group_id,
group_name,
linked_group_id,
operator,
parent_group_id,
partition_count,
spread_level,
state,
strategy,
tags
;

DELETE examples

Deletes the specified placement group. You must terminate all instances in the placement group before you can delete the placement group. You cannot delete a placement group that is a parent of a cluster placement group. Delete the cluster placement groups first. For more information, see Placement groups in the Amazon EC2 User Guide.

DELETE FROM aws.ec2.placement_groups
WHERE GroupName = '{{ GroupName }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;