I am using AWS android SDK to connect to AWS IoT. The following policy allow my app to successfully connect to AWS IoT except when i make this change
"Resource": "arn:aws:iot:us-west-2:1234567890xxx:topic/topic1" I have tried almost every possible custom option but the policy works only for "*" wild card that means "any resource and/or any topics".
Working example successfully connects android app to AWS IoT
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:us-west-2:1234567890xxx:client/mobile-client-master" }, { "Effect": "Allow", "Action": [ "iot:Publish", "iot:Subscribe", "iot:Receive" ], "Resource": "*" } ] }
This Json script fails to connect the android app to AWS IoT
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:us-west-2:1234567890xxx:client/mobile-client-master" }, { "Effect": "Allow", "Action": [ "iot:Publish", "iot:Subscribe", "iot:Receive" ], "Resource": "arn:aws:iot:us-west-2:1234567890xxx:topic/topic1" } ] }
I have tried almost every possible custom option but the policy works only for "*" wild card that means "any resource and/or any topics".