placement_groups
Creates, updates, deletes, gets or lists a placement_groups resource.
Overview
| Name | placement_groups |
| Type | Resource |
| Id | aws.ec2.placement_groups |
Fields
The following fields are returned by SELECT queries:
- describe_placement_groups
| Name | Datatype | Description |
|---|---|---|
group_arn | string | The Amazon Resource Name (ARN) of the placement group. |
group_id | string | The ID of the placement group. |
group_name | string | The name of the placement group. |
linked_group_id | string | Reserved for future use. |
operator | string | The service provider that manages the Placement Group. |
parent_group_id | string | The ID of the parent placement group. |
partition_count | integer | The number of partitions. Valid only if strategy is set to partition. |
spread_level | string | The spread level for the placement group. Only Outpost placement groups can be spread across hosts. |
state | string | The state of the placement group. |
strategy | string | The placement strategy. |
tags | string | Any tags applied to the placement group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_placement_groups | select | region | GroupId, DryRun, GroupName, Filter | 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. |
create_placement_group | insert | region | PartitionCount, TagSpecification, SpreadLevel, LinkedGroupId, Operator, ParentGroupId, DryRun, GroupName, Strategy | 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. |
delete_placement_group | delete | GroupName, region | DryRun | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
GroupName | string | The name of the placement group. |
region | string | AWS region (default: us-east-1) |
DryRun | boolean | 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. |
Filter | array | The 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. |
GroupId | array | The IDs of the placement groups. |
GroupName | string | A name for the placement group. Must be unique within the scope of your account for the Region. Constraints: Up to 255 ASCII characters |
LinkedGroupId | string | Reserved for future use. |
Operator | object | Reserved for internal use. |
ParentGroupId | string | The ID of a parent placement group. Valid only when Strategy is set to cluster. |
PartitionCount | integer | The number of partitions. Valid only when Strategy is set to partition. |
SpreadLevel | string | Determines how placement groups spread instances. Host – You can use host only with Outpost placement groups. Rack – No usage restrictions. |
Strategy | string | The placement strategy. |
TagSpecification | array | The tags to apply to the new placement group. |
SELECT examples
- describe_placement_groups
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
- create_placement_group
- Manifest
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
;
# Description fields are for documentation purposes
- name: placement_groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the placement_groups resource.
- name: PartitionCount
value: {{ PartitionCount }}
description: The number of partitions. Valid only when Strategy is set to partition.
description: The number of partitions. Valid only when Strategy is set to partition.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to apply to the new placement group.
description: The tags to apply to the new placement group.
- name: SpreadLevel
value: "{{ SpreadLevel }}"
description: Determines how placement groups spread instances. Host – You can use host only with Outpost placement groups. Rack – No usage restrictions.
description: Determines how placement groups spread instances. Host – You can use host only with Outpost placement groups. Rack – No usage restrictions.
- name: LinkedGroupId
value: "{{ LinkedGroupId }}"
description: Reserved for future use.
description: Reserved for future use.
- name: Operator
value: "{{ Operator }}"
description: Reserved for internal use.
description: Reserved for internal use.
- name: ParentGroupId
value: "{{ ParentGroupId }}"
description: The ID of a parent placement group. Valid only when Strategy is set to cluster.
description: The ID of a parent placement group. Valid only when Strategy is set to cluster.
- name: DryRun
value: {{ DryRun }}
description: 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.
description: 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.
- name: GroupName
value: "{{ GroupName }}"
description: A name for the placement group. Must be unique within the scope of your account for the Region. Constraints: Up to 255 ASCII characters
description: A name for the placement group. Must be unique within the scope of your account for the Region. Constraints: Up to 255 ASCII characters
- name: Strategy
value: "{{ Strategy }}"
description: The placement strategy.
description: The placement strategy.
DELETE examples
- delete_placement_group
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 }}'
;