Part 1 of building a “Serverless” Slackbot is to define the serverless configuration.
I will build on this and share more of the actual lambda and how to handle a nested request and eventually build a simple slackbot that executes this function.
A simple serverless.yml definition to define a Lambda function and pull API_KEY and API_SECRET from SSM Parameter Store, so you can safely manage the secret sauce.
# Read the docs https://serverless.com/framework/docs/
service: litwicki-lambda
provider:
name: aws
runtime: nodejs6.10 #we'll change this later
functions:
getCredits:
handler: handler.litwicki
events:
- http:
path: litwicki
method: get
cors: true
custom:
API_KEY: ${ssm:/path/to/ApiKey~true}
API_SECRET: ${ssm:/path/to/ApiSecret~true}
0 Comments