thing_shadows
Creates, updates, deletes, gets or lists a thing_shadows resource.
Overview
| Name | thing_shadows |
| Type | Resource |
| Id | aws.iot_data.thing_shadows |
Fields
The following fields are returned by SELECT queries:
- get_thing_shadow
| Name | Datatype | Description |
|---|---|---|
payload | string (byte) | The state information, in JSON format. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_thing_shadow | select | thing_name, region | name | Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide. |
update_thing_shadow | update | thing_name, region, payload | name | Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide. |
delete_thing_shadow | delete | thing_name, region | name | Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide. |
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 name of the thing. |
name | string | The name of the shadow. |
SELECT examples
- get_thing_shadow
Gets the shadow for the specified thing. Requires permission to access the GetThingShadow action. For more information, see GetThingShadow in the IoT Developer Guide.
SELECT
payload
FROM aws.iot_data.thing_shadows
WHERE thing_name = '{{ thing_name }}' -- required
AND region = '{{ region }}' -- required
AND name = '{{ name }}'
;
UPDATE examples
- update_thing_shadow
Updates the shadow for the specified thing. Requires permission to access the UpdateThingShadow action. For more information, see UpdateThingShadow in the IoT Developer Guide.
UPDATE aws.iot_data.thing_shadows
SET
payload = '{{ payload }}'
WHERE
thing_name = '{{ thing_name }}' --required
AND region = '{{ region }}' --required
AND payload = '{{ payload }}' --required
AND name = '{{ name}}'
RETURNING
payload;
DELETE examples
- delete_thing_shadow
Deletes the shadow for the specified thing. Requires permission to access the DeleteThingShadow action. For more information, see DeleteThingShadow in the IoT Developer Guide.
DELETE FROM aws.iot_data.thing_shadows
WHERE thing_name = '{{ thing_name }}' --required
AND region = '{{ region }}' --required
AND name = '{{ name }}'
;