
Run Lambdas functions from Slack for fun and profit with Opsidian.AI.
For over a year now we have seen the rise of chatbots all over the planet and in many different industries. The same trend is being seen in the Cloud and IT market, especially since we've been working with Amazon Web Services very closely. Last year, there has been the "AWS Serverless Chatbot" competition where one tool left the jury absolutely breathless.
At Nordcloud, we are working closely with the team at Opsidian.ai to get the latest and best out of using chatbots for both our customers and our own operations teams. Especially in the context of our Managed Cloud Service, this is a highly relevant aspect. We integrate with our customers on a deeper level and partner more closely through the use of chatbots and the related features and functions. In this blog post, we want to describe some of these aspects and encourage all of you to take a look at opsidian.ai in the near future.
Enabling real ChatOps
Opsidian helps you monitor and manage your AWS Infrastructure from Slack. Opsidian is a part of an increasingly popular trend, called ChatOps. ChatOps is about bringing your DevOps work to your chats and conversations within a team. You can, for example, deploy code, monitor servers, close issues in a bug tracker just by talking to a chatbot, which understands natural language or special commands. We have recognized that trend and Opsidian.ai was born - an AWS chatbot developed jointly with Nordcloud to manage AWS environments directly from Slack channels.
With Opsidian.ai you can bring your everyday cloud management and monitoring tasks to where your team is - a Slack channel. This way, team members gain a better visibility into the discussed items and accelerate change by having a common view of a problem.

/ops
structured command. Now, here's whats really new and interesting! Opsidian can run AWS Lambda functions directly from your Slack channel. The best part is that you can provide your own custom functions and effectively customize and extendOpsidian's functionality! So how's it done?
User Manual for Getting Started
Briefly, you register a Lambda function, existing in your account, with Opsidian. You choose your own command on which Lambda will be triggered (/ops run COMMAND)
. The Lambda has only one simple requirement: it needs to return a JSON object with a field called message.
Whatever is placed in this field will be directly returned to the Slack, let us see this example:
import json
def lambda_handler(event, context): message = "Hi from a Lambda function !" return json.dumps({ “message” : message }
As for permissions, make sure that the IAM role of Opsidian has “lambda:InvokeFunction” permissions, as described in http://opsidian.ai/lambda/.
Let’s configure some Lambda functions! If you have your own function, feel free to configure it. I will use the summarize-aws-services function, which is already provided by Opsidian in their repository: http://github.com/OpsidianAI/opsidian-lambda-functions.
First, a function needs to be registered with Opsidian, to do that — log in to the Opsidian Dashboard — https://dashboard.opsidian.ai/dashboard and proceed to the View Lambda Function panel.
Now, click the "Add a new Lambda function command". Choose your region, command name and fill in your function's ARN. The command you choose will be used to identify your function within Opsidian, i.e. /ops run COMMAND. Tick “wait for response” if you want to get the result from your Lambda passed back to Slack, Opsidian will wait 5s for the function to finish and wait for whatever is returned.
That's it! You can now test your function. Go to a Slack channel and execute your command, e.g./ops run summarise
As you can see, the summarize-aws-services function provides a simple summary of the most common resources used in your AWS Account, such as a number of ELB load balancers, EC2 instances or EMR clusters.


What's next?
We are very eager to enable our customers and partners in using products like opsidian.ai more broadly in their daily operations on Amazon Web Services. We encourage you to take the next logical steps on this journey:- Clone the https://github.com/OpsidianAI/opsidian-lambda-functions and code your Lambdas!
- Join the Opsidian slack channel http://opsidian.ai/slack/
- Meet Nordcloud at the AWS Summit Berlin and talk to us about how you can leverage ChatOps in your cloud!
Get in Touch.
Let’s discuss how we can help with your cloud journey. Our experts are standing by to talk about your migration, modernisation, development and skills challenges.
