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
Idawscc.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.

For more information, see AWS::IoT::ThingGroup.

Methods

NameResourceAccessible byRequired Params
create_resourcething_groupsINSERTregion
delete_resourcething_groupsDELETEIdentifier, region
update_resourcething_groupsUPDATEIdentifier, PatchDocument, region
list_resourcesthing_groups_list_onlySELECTregion
get_resourcething_groupsSELECTIdentifier, region

SELECT examples

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 awscc.iot.thing_groups
WHERE
region = 'us-east-1' AND
Identifier = '{{ thing_group_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.iot.thing_groups (
ThingGroupName,
ParentGroupName,
QueryString,
ThingGroupProperties,
Tags,
region
)
SELECT
'{{ thing_group_name }}',
'{{ parent_group_name }}',
'{{ query_string }}',
'{{ thing_group_properties }}',
'{{ tags }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a thing_group resource, using stack-deploy.

/*+ update */
UPDATE awscc.iot.thing_groups
SET PatchDocument = string('{{ {
"QueryString": query_string,
"ThingGroupProperties": thing_group_properties,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ thing_group_name }}';

DELETE example

/*+ delete */
DELETE FROM awscc.iot.thing_groups
WHERE
Identifier = '{{ thing_group_name }}' AND
region = 'us-east-1';

Permissions

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

iot:DescribeThingGroup,
iot:ListTagsForResource,
iot:CreateThingGroup,
iot:CreateDynamicThingGroup,
iot:TagResource