thing_groups
Creates, updates, deletes or gets a thing_group resource or lists thing_groups in a region
Overview
| Name | thing_groups |
| Type | Resource |
| Description | Resource Type definition for AWS::IoT::ThingGroup |
| Id | awscc.iot.thing_groups |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
arn | string | |
thing_group_name | string | |
parent_group_name | string | |
query_string | string | |
thing_group_properties | object | |
tags | array | An array of key-value pairs to apply to this resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
thing_group_name | string | |
region | string | AWS region. |
For more information, see AWS::IoT::ThingGroup.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | thing_groups | INSERT | region |
delete_resource | thing_groups | DELETE | Identifier, region |
update_resource | thing_groups | UPDATE | Identifier, PatchDocument, region |
list_resources | thing_groups_list_only | SELECT | region |
get_resource | thing_groups | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all thing_groups in a region.
SELECT
region,
thing_group_name
FROM awscc.iot.thing_groups_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new thing_group resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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 }}';
/*+ 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 }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: thing_group
props:
- name: thing_group_name
value: '{{ thing_group_name }}'
- name: parent_group_name
value: '{{ parent_group_name }}'
- name: query_string
value: '{{ query_string }}'
- name: thing_group_properties
value:
attribute_payload:
attributes: {}
thing_group_description: '{{ thing_group_description }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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:
- Create
- Delete
- List
- Read
- Update
iot:DescribeThingGroup,
iot:ListTagsForResource,
iot:CreateThingGroup,
iot:CreateDynamicThingGroup,
iot:TagResource
iot:DescribeThingGroup,
iot:DeleteThingGroup,
iot:DeleteDynamicThingGroup
iot:ListThingGroups,
iot:ListTagsForResource
iot:DescribeThingGroup,
iot:ListTagsForResource
iot:ListTagsForResource,
iot:DescribeThingGroup,
iot:UpdateThingGroup,
iot:UpdateDynamicThingGroup,
iot:TagResource,
iot:UntagResource