Overview
What you will need
- A Slack account (with configuration rights)
- An AWS account
- About 30 minutes!
- Slack: create a slash command; collect a security token
- AWS IAM: create a user; collect an Access Key ID and Secret Key
- Command Line: encrypt the security token with the access key + secret key
- AWS Lambda: create the function
- Slack: link slash command to AWS
- AWS Lambda: link to SAP notes
Step 1: Slack Slash Command
Go to https://.slack.com/apps/manage/custom-integrations, click on “Slash Command” and press the “Add Configuration” button.
Step 2: Create an AWS User
In your AWS account, go to the Identify & Access Management (IAM):
There, create a new user. And here comes a critical part: you need to show and store the security credentials, as these cannot be retrieved later on. I would recommend that you perform a copy / paste into a safe place rather that take a screenshot as below:
Step 3: Encrypt the Token
Last check before we can start the encryption: in AWS, call the Lamda service. From the URL, note your region (e.g. us-east-1):
Now, you can call the command line and type
aws configure
You will be asked to enter the information you already collected:
- AWS Access Key ID
- AWS Secret Access Key
- Default Region Name
- Default Output Format (leave blank and press enter)
Next, still in the command line, type
aws kms encrypt --key-id alias/ --plaintext "
The result should look somewhat like this:
Step 4: Create the Lambda Function
In AWS Lambda, click on the “Get Started Now” or “Create a Lambda Function” button. AWS has already prepared several blueprints for you. Simply filter with keyword slack and select “slack-echo-command”:
Step 5: Link Slack with AWS
Ready to test? Open your slack application. In any conversation (I prefer the slackbot one for tests), enter:
/sapnote 2345678
You should receive something like this:
Step 6: Link to SAP Notes
callback(null, `:scroll: <https://launchpad.support.sap.com/#/notes/${commandText}|SAP Note Search: ${commandText}>`);
Don’t forget to save your changes in AWS and test in Slack by entering command:
/sapnote 2345678
Result should look like this, with a link to https://launchpad.support.sap.com/#/notes/2345678:
Debugging
Token has not been set
Invalid request token
Any logs?
Conclusion
The example above might not be impressive as such, but showcases nicely how to setup the right platform in a very short time frame. You can now start building on this to create more fancy interaction. I, for one, can’t wait to see what you’ll come up with.
I highly recommend Paul Modderman’s excellent blog posts on Slack / SAP integration:
* https://blogs.sap.com/2016/03/18/slacking-off-1-of-3/
* https://blogs.sap.com/2016/03/18/slacking-off-2-of-3/
* https://blogs.sap.com/2016/03/18/slacking-off-3-of-3/
New NetWeaver Information at SAP.com
Very Helpfull
User Rating: Be the first one !