thing_groups
Creates, updates, deletes or gets a thing_group
resource or lists thing_groups
in a region
Overview
Name | thing_groups |
Type | Resource |
Description | Resource Type definition for AWS::IoT::ThingGroup |
Id | aws.iot.thing_groups |
Fields
Name | Datatype | Description |
---|---|---|
id | string | |
arn | string | |
thing_group_name | string | |
parent_group_name | string | |
query_string | string | |
thing_group_properties | object | |
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 |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all thing_groups
in a region.
SELECT
region,
id,
arn,
thing_group_name,
parent_group_name,
query_string,
thing_group_properties,
tags
FROM aws.iot.thing_groups
WHERE region = 'us-east-1';
Gets all properties from an individual thing_group
.
SELECT
region,
id,
arn,
thing_group_name,
parent_group_name,
query_string,
thing_group_properties,
tags
FROM aws.iot.thing_groups
WHERE region = 'us-east-1' AND data__Identifier = '<ThingGroupName>';
INSERT
example
Use the following StackQL query and manifest file to create a new thing_group
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.iot.thing_groups (
ThingGroupName,
ParentGroupName,
QueryString,
ThingGroupProperties,
Tags,
region
)
SELECT
'{{ ThingGroupName }}',
'{{ ParentGroupName }}',
'{{ QueryString }}',
'{{ ThingGroupProperties }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.thing_groups (
ThingGroupName,
ParentGroupName,
QueryString,
ThingGroupProperties,
Tags,
region
)
SELECT
'{{ ThingGroupName }}',
'{{ ParentGroupName }}',
'{{ QueryString }}',
'{{ ThingGroupProperties }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: thing_group
props:
- name: ThingGroupName
value: '{{ ThingGroupName }}'
- name: ParentGroupName
value: '{{ ParentGroupName }}'
- name: QueryString
value: '{{ QueryString }}'
- name: ThingGroupProperties
value:
AttributePayload:
Attributes: {}
ThingGroupDescription: '{{ ThingGroupDescription }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.iot.thing_groups
WHERE data__Identifier = '<ThingGroupName>'
AND region = 'us-east-1';
Permissions
To operate on the thing_groups
resource, the following permissions are required:
Create
iot:DescribeThingGroup,
iot:ListTagsForResource,
iot:CreateThingGroup,
iot:CreateDynamicThingGroup,
iot:TagResource
Delete
iot:DescribeThingGroup,
iot:DeleteThingGroup,
iot:DeleteDynamicThingGroup
List
iot:ListThingGroups,
iot:ListTagsForResource
Read
iot:DescribeThingGroup,
iot:ListTagsForResource
Update
iot:ListTagsForResource,
iot:DescribeThingGroup,
iot:UpdateThingGroup,
iot:UpdateDynamicThingGroup,
iot:TagResource,
iot:UntagResource