Deploy Hubot on AWS Lambda? - aws-lambda

I'm a noob using Hubot, so please bear with me.
I was going through Hubot's documentation ( https://hubot.github.com/docs/deploying/ ) and saw that we can deploy to Heroku, Unix systems and others.
May I know how can Hubot be deployed on AWS Lambda ?
Best Regards.

I was wondering the same thing. I think the answer is probably "yes, if your chat system can send you http when traffic happens". I think Lambda is probably a great choice, since each message in chat is an event to process according to the rules that your bot has. So, the Lambda function invocation model is a good fit - lots of tiny invokes. You might, though, want to filter the traffic that gets to the function, though, if your chat system is high-traffic.
For example Slack's Events API lets you subscribe to all of the things you might need the bot to see, I think. You'd then need to route those requests to your lambda function, which you could do via AWS API Gateway.
The existing hubot-slack adapter uses the Real-Time Messaging API, though, so you'd need to write your own adaptor for the Events API http that the API Gateway receives.
The same approach (and requirement) applies to other chat systems.

Related

Using Azure Event Grid for event-based communication between microservices

I'm looking to implement a event-based communication pattern between my microservices and I'm looking to use Azure Service Bus to handle the messaging. In the examples I've seen so far (e.g. Microsoft's eShopOnContainers) the events are handled by a common library that handles the event subscription/publishing. I'm wondering if the common library could be replaced with Azure's Event Grid service (I realise this could generate an opinion-based answer, so please remove this question if it is deemed so)?
I like how Event Grid has retry capabilities, receives events from Azure Service Bus, push-like functionality (meaning my microservice doesn't need to poll), as well as other features, so in my mind it seems like a good fit. However, I'm fairly new to the event-based communication concept so I'm well aware I could be missing something.
If Azure Event Grid could be used to handle the events, is it possible to send the event to a Web Api endpoint? Once again, the examples I've seen so far all send the event to a Azure Function trigger, but I'm not planning on using any Azure Functions for my microservices.
If anyone had any examples they could point me to where Azure Service Bus and Event Grid were used for communication between microservices, that would be appreciated.

Is Lambda required for Alexa App development?

Is Amazon Lambda required to make a fully functional Alexa voice application? If so, what can and cannot be done if Lambda is not desired?
No. You can create your own secure endpoint and configure that to your Alexa skill. You will be able to accomplish pretty much everything lambda can do for you.
You can have lambda or any hosted endpoint as your Alexa backend.
However, having lambda will help you easy integration with services within AWS like using dynamodb/redshift/s3 etc...
And moreover, the price of keeping your backend running in lambda is very much less/negligible as you can have tons of requests served in less than few dollars.

Slack Outgoing Webhook to Incoming Webhook in MS Teams

I'm trying to connect a Slack channel to Teams and to forward all messages to teams. I thought it would be as easy as using an outgoing webhook in Slack and and incoming webhook in Teams. However nothing is ever sent to Teams. Is this even possible without the use of some automation tool like Zapier or IFTTT?
I think there are probably a bunch of reasons this is not working - I can imagine there could be authentication issues, and also that the structure of the data coming from slack is unlikely to be what Teams can consume 100% as is. Basically, you're going to need some kind of intermediary, like perhaps an Azure Function or AWS Lambda (unless Zapier/IFTTT can offer something out of the box for this). Power Automate could be another option, incidentally.
As another option, you could look to a 3rd party that does something like this already, like m.io (Disclaimer: I have no affiliation with them, or even experience with their platform, I'm just aware of the existence of their tool).
With regards docs, have a look at Outgoing Webhooks for Slack and Incoming Webhooks for Teams. Even from the docs, you can see the format/structure is very different, so it's just a case of a small Cloud function to map input <-> output.

East/West communication in a AWS serverless microservice architecture

I am well aware of the fact that east/west, or service to service synchronous communication between services is not the gold standard, and should only be used sparingly in a microservice architecture. However, in every real world implementation of a microservice architecture, I have seen some use-cases which require it. For example, the user service is often needs to be communicated with by other services to get up the millisecond details on the user (I'm aware that event based sharing of that data is also a possibility, but in some cases that isn't always the right approach).
My question is, what is the best way to do function to function, service to service communication in a Lambda + API Gateway style architecture?
My guess is that making an http request back out on the domain name is not ideal, since it will require going back out over the internet to resolve DNS.
Is it using the SDK to do an invoke on the downstream function directly? Will this cause issue if the downstream function depends on an API Gateway Proxy Event structure?

How to setup Amazon Lambda with micro services in Node.js

I am looking forward to work in a Amazon Lambda with Node.js
They call it server less, So is it a better way to host our code then traditional hosting servers ?
I am open for the suggestions, thanks in advance!!
It is called serverless as you dont manage and maintain the underlying server and the runtime.
Basically you write your code in one of the supported languages, say node.js, and then configure events that will trigger your code.
Example in case of AWS, the events can be a API GW call, a SQS message, a SNS notification etc.
So it can be better depending on what you are planning on doing.
Do note that there are certain limits that AWS imposes by default on accounts for AWS Lambda.
Also there can be slight startup penalty for a Lambda.
A plus point of Lambda vs Hosting your code in EC2 is that with Lambda you dont get charged if your code is not used/triggered.
However, do note that for functions that have heavy usage it might be better to
host your own EC2.
Most important a Lambda has to be stateless.
Considering all the above factors you can take a call on whether AWS Lambda and Serverless Architecture fits your needs.

Resources