Created
March 24, 2016 15:20
-
-
Save dpjanes/80aa89b6dadae75c7d79 to your computer and use it in GitHub Desktop.
Why won't this AWS IoT Policy Work?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iot:Connect" | |
], | |
"Resource": [ | |
"*" | |
] | |
}, | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iot:Publish", | |
"iot:Subscribe" | |
], | |
"Resource": [ | |
"arn:aws:iot:us-east-1:896348747311:topic/iotdb/homestar/867ed8c6-710a-421c-90db-cd9ba6c30f27", | |
"arn:aws:iot:us-east-1:896348747311:topicfilter/iotdb/homestar/867ed8c6-710a-421c-90db-cd9ba6c30f27/*" | |
] | |
} | |
] | |
} |
The issue is you can't publish using a topicfilter. Here's the working solution
https://gist.github.com/dpjanes/c884baa64b52c3b74f22
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can successfully connect to AWS using this Policy, but I cannot Publish with MQTT to the following topic
iotdb/homestar/867ed8c6-710a-421c-90db-cd9ba6c30f27/urn:iotdb:thing:SmartThings:0fc60c38-65f0-43fe-a17b-aa00829d80a1:motion:smart-things-motion/meta
Note that if I attach a highly permissive Policy (iot:*, resource *) it works fine.