Open reisingerf opened 7 months ago
Turns out this may not be as straight forward as I was hoping.
While this should work in principle, it may run into practical issues.
The suggested code assumes that it can create a new SlackChannelConfiguration
. However, AWS currently only supports a single SlackChannelConfiguration
per channel. So if that SlackChannelConfiguration
has already been setup (somewhere, somehow), this will fail with a "Slack channel ... has already been configured" error.
While a SlackChannelConfiguration
can be imported into a stack, it would be read-only, i.e. no new topics could be added. See here for context.
I think an alternative could be to use an existing SNS Topic
rather than creating a new one. A topic that's provided by the same stack/process that's in control of the SlackChannelConfiguration
.
However, that means the monitored queue would need to support an existing SNS topic (ITopic
).
AWS Chatbot natively supports integration with Slack without the need for a custom Lambda.
For an idea of how that may work, see here.