1.0.3 • Published 4 months ago

@gammarers/aws-sns-slack-message-lambda-subscription v1.0.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

AWS SNS Slack Message Lambda Subscription

GitHub npm (scoped) PyPI Nuget GitHub Workflow Status (branch) GitHub release (latest SemVer)

This AWS CDK Construct is designed to post messages sent from an SNS topic to a Slack Webhook via a Lambda function. The Lambda function accepts JSON text as a message, formats it for Slack, and sends it to the Slack Webhook API.

Incoming Sample Message

npm.io

Installation

TypeScript

install by npm

npm install @gammarers/aws-sns-slack-message-lambda-subscription

install by yarn

yarn add @gammarers/aws-sns-slack-message-lambda-subscription

Python

pip install gammarers.aws-sns-slack-message-lambda-subscription

C# / .NET

dotnet add package Gammarers.CDK.AWS.SNSSlackMessageLambdaSubscription

Example

Please save it in AWS Secrets Manager in the following format.

get your slack webhook url parts

https://hooks.slack.com/services/<workspace>/<channel>/<whebook>
SecretKeySecretValue
Workspace\<workspace>
Channel\<channel>
Webhook\<whebook>

Code

import { SNSSlackMessageLambdaSubscription } from '@gammarer/aws-sns-slack-message-lambda-subscription';

declare const topic: sns.Topic;

new SNSSlackMessageLambdaSubscription(stack, 'SNSSlackMessageLambdaSubscription', {
  topic,
  slackWebhookSecretName: 'slak-webhook', // alredy saved slack webhook info.
});
{
    "text": ":mega: *TEST*",
    "attachments": [{
        "color": "#2eb886",
        "title": "CodePipeline pipeline execution *SUCCEED*",
        "title_link": "https://github.com/yicr",
        "fields": [
            {
                "title": "Pipeline",
                "value": "pipeline-name"
            }
        ]
    }]
}

License

This project is licensed under the Apache-2.0 License.

1.0.3

4 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.2.23

5 months ago

0.2.22

5 months ago

0.2.21

6 months ago

0.2.20

6 months ago

0.2.19

6 months ago

0.2.18

6 months ago

0.2.17

7 months ago

0.2.16

7 months ago

0.2.15

7 months ago

0.2.14

7 months ago

0.2.13

8 months ago

0.2.12

8 months ago

0.2.11

8 months ago

0.2.10

8 months ago

0.2.9

9 months ago

0.2.8

9 months ago

0.2.7

9 months ago

0.2.6

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.0

9 months ago