Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

amancevice/terraform-aws-slackbot-slash-command

Repository files navigation

AWS Lambda Slack Slash Command

terraform build

Add-on for amancevice/slackbot/aws terraform module to handle /slash-commands in your Slack App

Quickstart

module "slackbot" {
  source  = "amancevice/slackbot/aws"
  version = "~> 22.0"
  #
}

module "slackbot_slash_command" {
  source  = "amancevice/slackbot-slash-command/aws"
  version = "~> 19.0"

  # Required

  lambda_role_arn   = module.slackbot.role.arn
  slack_secret_name = module.slackbot.secret.name
  slack_topic_arn   = module.slackbot.topic.arn

  lambda_function_name = "my-slash-command"
  slack_slash_command  = "example"

  slack_response = jsonencode({
    response_type = "ephemeral | in_channel | dialog | modal"
    text          = ":sparkles: This will be the response"
    blocks        = [ /**/ ]
  })

  # Optional

  lambda_description          = "Slackbot handler for /example"
  lambda_kms_key_arn          = "<kms-key-arn>"
  lambda_memory_size          = 128
  lambda_timeout              = 3
  log_group_retention_in_days = 30
  slack_response_type         = "direct | modal"

  log_group_tags = { /**/ }
  lambda_tags    = { /**/ }
}