Skip to content

Use Slack Bot App instead of Incoming Webhooks for extra flexibility #254

@dsiguero

Description

@dsiguero

Is your request related to a new offering from AWS?

No 🛑 — this request is not related to an AWS offering, but rather to Slack’s supported authentication mechanisms.

Is this functionality available in the [AWS provider for Terraform]: N/A

Is your request related to a problem? Please describe.

Yes. The current module only supports Slack Incoming Webhooks, which are limited in flexibility. Specifically:

  • They are bound to a single channel.
  • To post to multiple channels, multiple webhook URLs are needed — one per channel/environment.
  • Webhooks do not support rich interactivity or future extensibility (like responding to threads, DMs, etc.).

This leads to duplication of webhook management across environments and limits Slack integration potential.

Describe the solution you'd like.

Support for Slack Bot Token-based authentication, via a Slack Bot App instead of incoming webhooks.

Advantages:

  • A single token can be reused to post to multiple channels.
  • Bot Apps can be invited to multiple channels at runtime (via Slack UI).
  • Makes cross-environment usage easier (e.g., staging and production can share one token).
  • Unlocks potential for richer interactions later (buttons, threads, etc.).

I imagine this would be implemented via:

  • A new slack_bot_token input (mutually exclusive with slack_webhook_url)
  • Possibly a new channel_override input if the Lambda should dynamically choose channels (optional)
  • Adjusting the Python Lambda code to call Slack's chat.postMessage API instead of using the webhook URL

Describe alternatives you've considered.

  • Maintaining one webhook per environment manually: this works but is clunky and error-prone.
  • Manually patching the Lambda after deployment to use a bot token: non-idiomatic and not maintainable.
  • Using a different module or custom solution: loses the value of this module’s established conventions and Terraform integration.

Additional context

Slack recommends using Bot Tokens for more complex or scalable use cases. This would modernize the module’s Slack integration and align better with current Slack platform best practices.

I’d be happy to contribute to the implementation or provide a proof-of-concept if helpful.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions