Skip to main content

thing_groups_for_things

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

Overview

Namething_groups_for_things
TypeResource
Idaws.iot.thing_groups_for_things

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
group_arnstringThe group ARN.
group_namestringThe group name. (pattern: <code>[a-zA-Z0-9:_-]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_thing_groups_for_thingselectthing_name, regionnextToken, maxResultsList the thing groups to which the specified thing belongs. Requires permission to access the ListThingGroupsForThing action.
update_thing_groups_for_thingupdateregionUpdates the groups to which the thing belongs. Requires permission to access the UpdateThingGroupsForThing 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_namestringThe thing name.
maxResultsintegerThe maximum number of results to return at one time.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

SELECT examples

List the thing groups to which the specified thing belongs. Requires permission to access the ListThingGroupsForThing action.

SELECT
group_arn,
group_name
FROM aws.iot.thing_groups_for_things
WHERE thing_name = '{{ thing_name }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;

UPDATE examples

Updates the groups to which the thing belongs. Requires permission to access the UpdateThingGroupsForThing action.

UPDATE aws.iot.thing_groups_for_things
SET
thingName = '{{ thingName }}',
thingGroupsToAdd = '{{ thingGroupsToAdd }}',
thingGroupsToRemove = '{{ thingGroupsToRemove }}',
overrideDynamicGroups = {{ overrideDynamicGroups }}
WHERE
region = '{{ region }}' --required;