amazon-web-servicesamazon-snsaws-chatbot

Persnickety AWS Chatbot won't send messages to slack except for the test message


I've got a SNS topic setup that has two subscribers:

  1. The AWS Chatbot
  2. An Email Address

If I sent a test message in the AWS console using the "Send Test Message" button in the AWS Chatbot UI then the message is seen both subscribers and I see a message sent to the slack channel and delivered to my email address. However, if I publish a message using the aws cli or even using the AWS Console "Publish Message" button in the SNS topic UI only the email subscriber delivers the message to my inbox. I never see those messages in slack from the AWS chatbot.

So I figured out the test message that AWS Chatbot was delivering, and it's a JSON object like this (I've added spacing to help with readability):

{
   "source":"chatbot",
   "notificationType":"ChatbotSystemTest",
   "notificationSource":"sns",
   "configurationName":"awschat-bot-slack-engineering",
   "workspaceId":"1231231231231"
}

If I publish that exact message in either the AWS console with Publish Message or the aws cli then it will post to slack. Here is an example of how I'm publishing the message that the chatbot will pass along to slack.

 aws sns publish \
   --topic-arn arn:aws:sns:xxxxx:xxxxxxx:topicName \
   --message '{"source":"solr,"notificationType":"ChatbotSystemTest","notificationSource":"sns","configurationName":"awschat-bot-slack-engineering","workspaceId":"xxxxxxx"}'

However, if I modify that message by changing the source or notificationType it doesn't show up in slack. The email subscriber still delivers the message every time without judgement.

So why is the AWS Chatbot being so GD persnickety?


Solution

  • You must avail yourself of any pretenses that reading the documentation shouldn't be required for such a modest feature. Nay! For you may NOT just send ANY old message to AWS Chatbot. Heavens no for that would offend its magnificent engineering decisions to only support certain services and certain messages. You must conduct yourselves in a becoming manner and send a "Customized Notification". And hence your message must conform to the particulars of JSON and AWS Chatbot's most royal JSON format. The minimal of messages bearing this un-awkward format is thusly:

    {
       "version": "1.0", 
       "source":"custom", 
       "content": { 
          "description": "Can you believe this junk!!  AWS Chatbot is being annoying!!  Beg your pardon.  My frustration has gotten the best of me.  Oh please sanctimonious sir will you deliver this paltry message so that I may tell my lords and ladies I completed the quest given to me?"
       }
    }
    

    The documentation does discuss the particulars and required fields most of which have fixed values that while could be provided by AWS Chatbot. It couldn't be bothered to do so. Wrapping plebeian messages of such commoner usage as raw text would sully its good engineering to do so. So conduct thyself properly when you are in its midst for only the most righteous of you shall pass.