Package Exports
- @cdkx/aws-sns-subscriptions
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cdkx/aws-sns-subscriptions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
AWS SNS Subscription extensions
Subscription targets
Slack Subscription
Get it from npm
npm install @cdkx/aws-sns-subscriptions --save // using npm
yarn add @cdkx/aws-sns-subscriptions // using yarnGetting Started
Add a SNS Topic to your stack
import { Topic } from '@aws-cdk/aws-sns';
// create topic
const myTopic = new Topic(this, 'MyTopic');Add an slack bot enabled subscription to your topic.
import { SlackSubscription } from '@cdkx/aws-sns-subscriptions';
// add slack subscription to alongside with other subscription targets
myTopic.addSubscription(
new SlackSubscription({
channelName: 'my-channel',
})
);Add Token to parameter
Once stack has deployed, a new System Parameter resources will be made available. There add a slack bot oAuth token next to property authToken.
Required Scopes for these token depend of level of context provided to subscription target.
When channelId is provided, OAuthToken will only need chat:write:bot. But if no channelId is preset, channel id will be resolved from slack api and to do that OAuth token will need additional
channels:read, groups:read, im:read, mpim:read scopes.