Skip to main content

thing_groups

Creates, updates, deletes or gets a thing_group resource or lists thing_groups in a region

Overview

Namething_groups
TypeResource
DescriptionResource Type definition for AWS::IoT::ThingGroup
Idaws.iot.thing_groups

Fields

NameDatatypeDescription
idstring
arnstring
thing_group_namestring
parent_group_namestring
query_stringstring
thing_group_propertiesobject
tagsarrayAn array of key-value pairs to apply to this resource.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.iot.thing_groups (
ThingGroupName,
ParentGroupName,
QueryString,
ThingGroupProperties,
Tags,
region
)
SELECT
'{{ ThingGroupName }}',
'{{ ParentGroupName }}',
'{{ QueryString }}',
'{{ ThingGroupProperties }}',
'{{ Tags }}',
'{{ region }}';

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