subscriptions
Creates, updates, deletes, gets or lists a subscriptions resource.
Overview
| Name | subscriptions |
| Type | Resource |
| Id | aws.iot_data.subscriptions |
Fields
The following fields are returned by SELECT queries:
- list_subscriptions
| Name | Datatype | Description |
|---|---|---|
qos | integer | The Quality of Service (QoS) level for the subscription. Valid values are 0 (at most once) and 1 (at least once). |
topic_filter | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_subscriptions | select | client_id, region | nextToken, maxResults | 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. |
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 |
|---|---|---|
client_id | string | The 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. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of subscriptions to return in a single request. By default, this is set to 20. |
nextToken | string | To retrieve the next set of results, the nextToken value from a previous response; otherwise null to receive the first set of results. |
SELECT examples
- list_subscriptions
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 }}'
;