placement_groups
Creates, updates, deletes or gets a placement_group
resource or lists placement_groups
in a region
Overview
Name | placement_groups |
Type | Resource |
Description | Resource Type definition for AWS::EC2::PlacementGroup |
Id | aws.ec2.placement_groups |
Fields
Name | Datatype | Description |
---|---|---|
strategy | string | The placement strategy. |
group_name | string | The Group Name of Placement Group. |
spread_level | string | The Spread Level of Placement Group is an enum where it accepts either host or rack when strategy is spread |
partition_count | integer | The number of partitions. Valid only when **Strategy** is set to `partition` |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.placement_groups (
Strategy,
SpreadLevel,
PartitionCount,
Tags,
region
)
SELECT
'{{ Strategy }}',
'{{ SpreadLevel }}',
'{{ PartitionCount }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.placement_groups (
Strategy,
SpreadLevel,
PartitionCount,
Tags,
region
)
SELECT
'{{ Strategy }}',
'{{ SpreadLevel }}',
'{{ PartitionCount }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: placement_group
props:
- name: Strategy
value: '{{ Strategy }}'
- name: SpreadLevel
value: '{{ SpreadLevel }}'
- name: PartitionCount
value: '{{ PartitionCount }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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