Skip to main content

thing_groups

Creates, updates, deletes, gets or lists a thing_groups resource.

Overview

Namething_groups
TypeResource
Idaws.iot.thing_groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
index_namestringThe dynamic thing group index name. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
query_stringstringThe dynamic thing group search query string.
query_versionstringThe dynamic thing group query version.
statusstringThe dynamic thing group status. (ACTIVE, BUILDING, REBUILDING)
thing_group_arnstringThe thing group ARN.
thing_group_idstringThe thing group ID. (pattern: <code>[a-zA-Z0-9-]+</code>)
thing_group_metadataobjectThing group metadata.
thing_group_namestringThe name of the thing group. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
thing_group_propertiesobjectThing group properties.
versioninteger (int64)The version of the thing group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_thing_groupselectthing_group_name, regionDescribe a thing group. Requires permission to access the DescribeThingGroup action.
list_thing_groupsselectregionnextToken, maxResults, parentGroup, namePrefixFilter, recursiveList the thing groups in your account. Requires permission to access the ListThingGroups action.
create_dynamic_thing_groupinsertthing_group_name, region, queryStringCreates a dynamic thing group. Requires permission to access the CreateDynamicThingGroup action.
create_thing_groupinsertthing_group_name, regionCreate a thing group. This is a control plane operation. See Authorization for information about authorizing control plane actions. If the ThingGroup that you create has the exact same attributes as an existing ThingGroup, you will get a 200 success response. Requires permission to access the CreateThingGroup action.
update_thing_groupupdatething_group_name, region, thingGroupPropertiesUpdate a thing group. Requires permission to access the UpdateThingGroup action.
add_thing_to_thing_groupupdateregionAdds a thing to a thing group. Requires permission to access the AddThingToThingGroup action.
delete_thing_groupdeletething_group_name, regionexpectedVersionDeletes a thing group. Requires permission to access the DeleteThingGroup action.
delete_dynamic_thing_groupexecthing_group_name, regionexpectedVersionDeletes a dynamic thing group. Requires permission to access the DeleteDynamicThingGroup action.
update_dynamic_thing_groupexecthing_group_name, region, thingGroupPropertiesUpdates a dynamic thing group. Requires permission to access the UpdateDynamicThingGroup action.
remove_thing_from_thing_groupexecregionRemove the specified thing from the specified group. You must specify either a thingGroupArn or a thingGroupName to identify the thing group and either a thingArn or a thingName to identify the thing to remove from the thing group. Requires permission to access the RemoveThingFromThingGroup action.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
thing_group_namestringThe name of the dynamic thing group to update.
expectedVersioninteger (int64)The expected version of the dynamic thing group to delete.
maxResultsintegerThe maximum number of results to return at one time.
namePrefixFilterstringA filter that limits the results to those with the specified name prefix.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.
parentGroupstringA filter that limits the results to those with the specified parent group.
recursivebooleanIf true, return child groups as well.

SELECT examples

Describe a thing group. Requires permission to access the DescribeThingGroup action.

SELECT
index_name,
query_string,
query_version,
status,
thing_group_arn,
thing_group_id,
thing_group_metadata,
thing_group_name,
thing_group_properties,
version
FROM aws.iot.thing_groups
WHERE thing_group_name = '{{ thing_group_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a dynamic thing group. Requires permission to access the CreateDynamicThingGroup action.

INSERT INTO aws.iot.thing_groups (
thingGroupProperties,
indexName,
queryString,
queryVersion,
tags,
thing_group_name,
region
)
SELECT
'{{ thingGroupProperties }}',
'{{ indexName }}',
'{{ queryString }}' /* required */,
'{{ queryVersion }}',
'{{ tags }}',
'{{ thing_group_name }}',
'{{ region }}'
RETURNING
index_name,
query_string,
query_version,
thing_group_arn,
thing_group_id,
thing_group_name
;

UPDATE examples

Update a thing group. Requires permission to access the UpdateThingGroup action.

UPDATE aws.iot.thing_groups
SET
thingGroupProperties = '{{ thingGroupProperties }}',
expectedVersion = {{ expectedVersion }}
WHERE
thing_group_name = '{{ thing_group_name }}' --required
AND region = '{{ region }}' --required
AND thingGroupProperties = '{{ thingGroupProperties }}' --required
RETURNING
version;

DELETE examples

Deletes a thing group. Requires permission to access the DeleteThingGroup action.

DELETE FROM aws.iot.thing_groups
WHERE thing_group_name = '{{ thing_group_name }}' --required
AND region = '{{ region }}' --required
AND expectedVersion = '{{ expectedVersion }}'
;

Lifecycle Methods

Deletes a dynamic thing group. Requires permission to access the DeleteDynamicThingGroup action.

EXEC aws.iot.thing_groups.delete_dynamic_thing_group
@thing_group_name='{{ thing_group_name }}' --required,
@region='{{ region }}' --required,
@expectedVersion='{{ expectedVersion }}'
;