MQTT republish fails - AWS IoT Message routing rules

0

I have a message routing rule setup in AWS IoT that republishes a LWT message to this topic below

$$aws/things/demothing_01/shadow/update

The LWT message is getting triggered and I have tested this. The exact same rule does not work in Frankfurt (eu-central-1)

But what is stranger is that the exact same republish rule works in Singapore region (ap-southeast-1). I have set this up in both these regions.

I am extremely familiar with all the rules, roles, policies etc. as I have been using AWS for a couple of years now. I have checked everything again and again and again. The EXACT rule works in different region. I have used identical roles and policies to test this. Any suggestions? This is what I find in the CloudWatch logs.

"errorMessage": "Failed to republish to topic. Received Server error. The error code is 403. Message arrived on: lwt/things/demothing_01/update, Topic: $aws/things/demothing_01/shadow/update"

For the republish rule, I have used $$ instead of just $ as mentioned in the docs and as I mentioned the same rule works in ap-southeast-1. I have tried single $ too but that works only when I use the built-in MQTT Client in AWS console to directly (manually) send a message. It does not work when set up as a Message routing rule.

MMX
asked 9 months ago272 views
1 Answer
1
Accepted Answer

Hi,

It might be a permission issue. Have you checked that the IAM role associated to the rule has the right permissions to publish to the topic in both regions?

AWS
EXPERT
answered 8 months ago
  • hi,

    Appreciate your reply. Yes, I did thoroughly check the permissions. I kept a separate window open ( from the working region ), and made a ditto copy in the other region. It doesn't work. Also I did not notice anything in the Cloudwatch logs that is related to permissions. I even gave full IoT rights to that role/policy :(

    Cheers, MM

  • hi,

    When I changed the policy to allow publishing to ANY topic, it seems to work. It could be one of those fine-grained permissions that messed up. Thanks for your answer; it made me relook at all the permissions. Thanks once again & Cheers.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions