Skip to main content

subscriptions

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

Overview

Namesubscriptions
TypeResource
Idaws.iot_data.subscriptions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
qosintegerThe Quality of Service (QoS) level for the subscription. Valid values are 0 (at most once) and 1 (at least once).
topic_filterstringThe topic filter pattern that the client is subscribed to. May include MQTT wildcards such as + (single-level) and # (multi-level).

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_subscriptionsselectclient_id, regionnextToken, maxResultsReturns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions. Requires permission to access the ListSubscriptions action.

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
client_idstringThe unique identifier of the MQTT client to list subscriptions for. The client ID can't start with a dollar sign ($). MQTT client IDs must be URL encoded (percent-encoded) when they contain characters that are not valid in HTTP requests, such as spaces, forward slashes (/), and UTF-8 characters.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of subscriptions to return in a single request. By default, this is set to 20.
nextTokenstringTo retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results.

SELECT examples

Returns a list of all subscriptions for MQTT clients with active sessions, including offline clients with persistent sessions. Requires permission to access the ListSubscriptions action.

SELECT
qos,
topic_filter
FROM aws.iot_data.subscriptions
WHERE client_id = '{{ client_id }}' -- required
AND region = '{{ region }}' -- required
AND nextToken = '{{ nextToken }}'
AND maxResults = '{{ maxResults }}'
;