AWS SNS Slack Message Lambda Subscription
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
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>
| SecretKey | SecretValue |
|---|---|
| Workspace | |
| Channel | |
| Webhook |
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.
Metadata
Release files for gammarers.aws-sns-slack-message-lambda-subscription 1.0.31
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gammarers_aws_sns_slack_message_lambda_subscription-1.0.31.tar.gz | 508.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gammarers_aws_sns_slack_message_lambda_subscription-1.0.31-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.0 MB
Release files / gammarers_aws_sns_slack_message_lambda_subscription-1.0.31.tar.gz
| Download URL | gammarers_aws_sns_slack_message_lambda_subscription-1.0.31.tar.gz |
|---|---|
| Size | 508.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37f1adc466331d2c7a4c0b4a8572390e346dc674de94fe4f9358c6032ccc67e3
|
|
BLAKE2b-256 checksum How to use checksums |
a9c3afa34085b1ff2d3960769acef67021c58af2dd892ea8bf8fc16a978af478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|
Release files / gammarers_aws_sns_slack_message_lambda_subscription-1.0.31-py3-none-any.whl
| Download URL | gammarers_aws_sns_slack_message_lambda_subscription-1.0.31-py3-none-any.whl |
|---|---|
| Size | 506.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7cfc9c8088e07d56a0e496488faf359110b33b7e84b40cbc93217ced4210434
|
|
BLAKE2b-256 checksum How to use checksums |
094b53487a1a5fd8f1ac593186cba81f52c361c71eb5c42c24bb9e546c499949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.14.7
|