thing_connectivity_datas
Creates, updates, deletes, gets or lists a thing_connectivity_datas resource.
Overview
| Name | thing_connectivity_datas |
| Type | Resource |
| Id | aws.iot.thing_connectivity_datas |
Fields
The following fields are returned by SELECT queries:
- get_thing_connectivity_data
| Name | Datatype | Description |
|---|---|---|
clean_session | boolean | Indicates whether the client is using a clean session. Returns true for clean sessions. |
client_id | string | The unique identifier of the MQTT client. |
connected | boolean | A Boolean that indicates the connectivity status. |
disconnect_reason | string | The reason that the client is disconnected. (AUTH_ERROR, CLIENT_INITIATED_DISCONNECT, CLIENT_ERROR, CONNECTION_LOST, DUPLICATE_CLIENTID, FORBIDDEN_ACCESS, MQTT_KEEP_ALIVE_TIMEOUT, SERVER_ERROR, SERVER_INITIATED_DISCONNECT, API_INITIATED_DISCONNECT, THROTTLED, WEBSOCKET_TTL_EXPIRATION, CUSTOMAUTH_TTL_EXPIRATION, UNKNOWN, NONE) |
keep_alive_duration | integer | The keep-alive interval in seconds that the client specified when establishing the connection. |
session_expiry | integer (int64) | The session expiry interval in seconds for the MQTT client connection. This value indicates how long the session will remain active after the client disconnects. |
source_ip | string | The IP address of the client that initiated the connection. |
source_port | integer | The client's source port. |
target_ip | string | The IP address of the Amazon Web Services IoT Core endpoint that the client connected to. |
target_port | integer | The port number of the Amazon Web Services IoT Core endpoint that the client connected to. |
thing_name | string | The name of your IoT thing. (pattern: <code>[a-zA-Z0-9:_-]+</code>) |
timestamp | string (date-time) | The timestamp of when the device connected or disconnected. |
vpc_endpoint_id | string | The ID of the VPC endpoint. Present for clients connected to Amazon Web Services IoT Core via a VPC endpoint. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_thing_connectivity_data | select | thing_name, region | Retrieves the live connectivity status per device. If a device has never connected to IoT Core or was disconnected for more than 1 hour before fleet indexing's thingConnectivityIndexingMode was enabled, the response will have the connected field set to false with no additional session details. |
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 your IoT thing. |
SELECT examples
- get_thing_connectivity_data
Retrieves the live connectivity status per device. If a device has never connected to IoT Core or was disconnected for more than 1 hour before fleet indexing's thingConnectivityIndexingMode was enabled, the response will have the connected field set to false with no additional session details.
SELECT
clean_session,
client_id,
connected,
disconnect_reason,
keep_alive_duration,
session_expiry,
source_ip,
source_port,
target_ip,
target_port,
thing_name,
timestamp,
vpc_endpoint_id
FROM aws.iot.thing_connectivity_datas
WHERE thing_name = '{{ thing_name }}' -- required
AND region = '{{ region }}' -- required
;