Skip to main content

placement_groups

Creates, updates, deletes or gets a placement_group resource or lists placement_groups in a region

Overview

Nameplacement_groups
TypeResource
DescriptionResource Type definition for AWS::EC2::PlacementGroup
Idaws.ec2.placement_groups

Fields

NameDatatypeDescription
strategystringThe placement strategy.
group_namestringThe Group Name of Placement Group.
spread_levelstringThe Spread Level of Placement Group is an enum where it accepts either host or rack when strategy is spread
partition_countintegerThe number of partitions. Valid only when **Strategy** is set to `partition`
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all placement_groups in a region.

SELECT
region,
strategy,
group_name,
spread_level,
partition_count,
tags
FROM aws.ec2.placement_groups
WHERE region = 'us-east-1';

Gets all properties from an individual placement_group.

SELECT
region,
strategy,
group_name,
spread_level,
partition_count,
tags
FROM aws.ec2.placement_groups
WHERE region = 'us-east-1' AND data__Identifier = '<GroupName>';

INSERT example

Use the following StackQL query and manifest file to create a new placement_group resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ec2.placement_groups (
Strategy,
SpreadLevel,
PartitionCount,
Tags,
region
)
SELECT
'{{ Strategy }}',
'{{ SpreadLevel }}',
'{{ PartitionCount }}',
'{{ Tags }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.placement_groups
WHERE data__Identifier = '<GroupName>'
AND region = 'us-east-1';

Permissions

To operate on the placement_groups resource, the following permissions are required:

Create

ec2:CreatePlacementGroup,
ec2:DescribePlacementGroups,
ec2:CreateTags

Read

ec2:DescribePlacementGroups

Delete

ec2:DeletePlacementGroup,
ec2:DescribePlacementGroups

List

ec2:DescribePlacementGroups