Integrate Rubrik Polaris, AWS Lambda, and Slack to automate the creation of new Polaris users.
Slack Slash Commands require a response within 3 seconds so in order to avoid timeout errors we need to utillize two seperate Lambda functions -- a response function and a worker function.
The main purpose of the slack_response
function is to send a 200 status code back to Slack as quickly as possible in order to avoid timeout errors. The function also collects all of the relevant variables and passes those to the worker_function
through the Amazon Simple Notification Service (SNS).
The function will be triggered through the Amazon API Gateway that the Slash Command will initially call. The URL provided by the API Gateway will need to be populated in the Request URL
field when creating the Slash Command.
You'll also need to populate the follow Envrionment variables which will be ready by the function. The kmsEncryptedToken
, which corresponds to the Slash Commands Verification Token
, and the polaris_password
will need to be encrypted.
The sns_arn
field corresponds to the Amazon Resource Name of the SNS topic that is subscribed to the worker_function
.
Once the worker_function
is triggered by Amazon SNS it will parse all of the variables sent by the slack_response
function and then validate the information that was provide by the user through Slack. Once those checks have completed it will connect to the Rubrik Polaris account and attempt to create a new user. From there it will send a response to Slack with either a success message or relevant error message in human readable format if possible.