Skip to main content

thing_connectivity_datas

Creates, updates, deletes, gets or lists a thing_connectivity_datas resource.

Overview​

Namething_connectivity_datas
TypeResource
Idaws.iot.thing_connectivity_datas

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
clean_sessionbooleanIndicates whether the client is using a clean session. Returns true for clean sessions.
client_idstringThe unique identifier of the MQTT client.
connectedbooleanA Boolean that indicates the connectivity status.
disconnect_reasonstringThe 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_durationintegerThe keep-alive interval in seconds that the client specified when establishing the connection.
session_expiryinteger (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_ipstringThe IP address of the client that initiated the connection.
source_portintegerThe client's source port.
target_ipstringThe IP address of the Amazon Web Services IoT Core endpoint that the client connected to.
target_portintegerThe port number of the Amazon Web Services IoT Core endpoint that the client connected to.
thing_namestringThe name of your IoT thing. (pattern: <code>[a-zA-Z0-9:_-]+</code>)
timestampstring (date-time)The timestamp of when the device connected or disconnected.
vpc_endpoint_idstringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_thing_connectivity_dataselectthing_name, regionRetrieves 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
thing_namestringThe name of your IoT thing.

SELECT examples​

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
;