thing_groups_for_things
Creates, updates, deletes, gets or lists a thing_groups_for_things resource.
Overview
| Name | thing_groups_for_things |
| Type | Resource |
| Id | aws.iot.thing_groups_for_things |
Fields
The following fields are returned by SELECT queries:
- list_thing_groups_for_thing
| Name | Datatype | Description |
|---|---|---|
group_arn | string | The group ARN. |
group_name | string | The group name. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_thing_groups_for_thing | select | thing_name, region | nextToken, maxResults | List the thing groups to which the specified thing belongs. Requires permission to access the ListThingGroupsForThing action. |
update_thing_groups_for_thing | update | region | Updates 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
thing_name | string | The thing name. |
maxResults | integer | The maximum number of results to return at one time. |
nextToken | string | To 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_thing_groups_for_thing
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
- update_thing_groups_for_thing
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;