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 | aws.iot.things |
Fields
| Name | Datatype | Description |
|---|---|---|
id | string | |
arn | string | |
attribute_payload | object | |
thing_name | string | |
region | string | AWS region. |
For more information, see AWS::IoT::Thing.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT examples
Gets all things in a region.
SELECT
region,
id,
arn,
attribute_payload,
thing_name
FROM aws.iot.things
WHERE region = 'us-east-1';
Gets all properties from an individual thing.
SELECT
region,
id,
arn,
attribute_payload,
thing_name
FROM aws.iot.things
WHERE region = 'us-east-1' AND data__Identifier = '<ThingName>';
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 aws.iot.things (
AttributePayload,
ThingName,
region
)
SELECT
'{{ AttributePayload }}',
'{{ ThingName }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.iot.things (
AttributePayload,
ThingName,
region
)
SELECT
'{{ AttributePayload }}',
'{{ ThingName }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: thing
props:
- name: AttributePayload
value:
Attributes: {}
- name: ThingName
value: '{{ ThingName }}'
DELETE example
/*+ delete */
DELETE FROM aws.iot.things
WHERE data__Identifier = '<ThingName>'
AND region = 'us-east-1';
Permissions
To operate on the things resource, the following permissions are required:
Create
iot:CreateThing,
iot:DescribeThing
Delete
iot:DeleteThing,
iot:DescribeThing
List
iot:ListThings
Read
iot:DescribeThing
Update
iot:UpdateThing,
iot:DescribeThing