You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
However, immediately above this is an example of a topic filter with a + in it and it says:
For devices registered as things in the AWS IoT Core registry, the following policy grants permission to connect to AWS IoT Core with the client ID that matches the thing name, and to subscribe to the topic filter some/+/topic only:
Is this intended?
The text was updated successfully, but these errors were encountered:
Any updates? I think what the note means is as follows:
Policies and MQTT interpret topic filter strings differently.
In MQTT subscription, + is treated as a wildcard for topic filter while in policies + is treated as a literal, not a wildcard.
Attempts to subscribe to topic filters pattern some/+/topic are considered some/{any string}/topic by MQTT but only some/+/topic by policies, and in policies these attempts fail and cause the client to disconnect.
I added a table to the topic you pointed out for more clarification. The content will be published to public soon.
Wildcard character
Is MQTT wildcard character
Example in MQTT
Is AWS IoT Core policy wildcard character
Example in AWS IoT Core policies for MQTT clients
#
Yes
some/#
No
N/A
+
Yes
some/+/topic
No
N/A
*
No
N/A
Yes
topicfilter/some/*/topic
And these are the facts you might also be interested in when you pecify topicfilter in the Resource ARN for the iot:Subscribe action:
arn:aws:iot:region:account:topicfilter/test/topic subscribes to a single topic name arn:aws:iot:region:account:topicfilter/test/* subscribes to multiple topic names (like test/# in MQTT) arn:aws:iot:region:account:topicfilter/test/*/topic subscribes to multiple topic names (like test/+/topic in MQTT)
The documentation says that
+
and#
wildcards are treated as literal values and that customers should use*
wildcards.https://github.com/awsdocs/aws-iot-docs/blame/7b216b17d6c51a45fba81ab566dc9bd7d46181ea/developerguide/pub-sub-policy.md#L228
However, immediately above this is an example of a topic filter with a
+
in it and it says:Is this intended?
The text was updated successfully, but these errors were encountered: