Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

AWS Lambda Notes

luglo edited this page Feb 21, 2019 · 1 revision

One task in the lambda handler is to distinguish between the different origins of the invocation (phone call, slack chat, test chat etc.). A way to figure out from where the function has been triggered is the requestAttributes field of the provided event. Here are the different structures respective to the origin.

AWS Lex Testing Chat

'requestAttributes': None

AWS Connect Invocation

'requestAttributes': {'x-amz-lex:accept-content-types': 'PlainText,SSML'}

Slack Chat Bot

'requestAttributes': {'x-amz-lex:channel-id': '***', 'x-amz-lex:webhook-endpoint-url': 'https://channels.lex.eu-west-1.amazonaws.com/slack/webhook/***', 'x-amz-lex:accept-content-types': 'PlainText', 'x-amz-lex:user-id': '***', 'x-amz-lex:slack-team-id': '***', 'x-amz-lex:slack-bot-token': '***', 'x-amz-lex:channel-name': 'Slack', 'x-amz-lex:channel-type': 'Slack'}

Clone this wiki locally