things
Creates, updates, deletes or gets a thing resource or lists things in a region
Overview
| Name | things |
| Type | Resource |
| Description | Resource Type definition for AWS::IoT::Thing |
| Id | awscc.iot.things |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
arn | string | |
attribute_payload | object | |
thing_name | string | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
thing_name | string | |
region | string | AWS region. |
For more information, see AWS::IoT::Thing.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | things | INSERT | region |
delete_resource | things | DELETE | Identifier, region |
update_resource | things | UPDATE | Identifier, PatchDocument, region |
list_resources | things_list_only | SELECT | region |
get_resource | things | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual thing.
SELECT
region,
id,
arn,
attribute_payload,
thing_name
FROM awscc.iot.things
WHERE
region = 'us-east-1' AND
Identifier = '{{ thing_name }}';
Lists all things in a region.
SELECT
region,
thing_name
FROM awscc.iot.things_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new thing resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.things (
AttributePayload,
ThingName,
region
)
SELECT
'{{ attribute_payload }}',
'{{ thing_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.things (
AttributePayload,
ThingName,
region
)
SELECT
'{{ attribute_payload }}',
'{{ thing_name }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: thing
props:
- name: attribute_payload
value:
attributes: {}
- name: thing_name
value: '{{ thing_name }}'
UPDATE example
Use the following StackQL query and manifest file to update a thing resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.things
SET PatchDocument = string('{{ {
"AttributePayload": attribute_payload
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ thing_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.things
WHERE
Identifier = '{{ thing_name }}' AND
region = 'us-east-1';
Permissions
To operate on the things resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
iot:CreateThing,
iot:DescribeThing
iot:DeleteThing,
iot:DescribeThing
iot:ListThings
iot:DescribeThing
iot:UpdateThing,
iot:DescribeThing