Skip to main content

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

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)

Source distribution for gammarers.aws-sns-slack-message-lambda-subscription 1.0.31
File Size Uploaded
gammarers_aws_sns_slack_message_lambda_subscription-1.0.31.tar.gz 508.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gammarers.aws-sns-slack-message-lambda-subscription 1.0.31
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.0.31 This release

2 release files

1.0.29

2 release files

1.0.28

2 release files

1.0.27

2 release files

1.0.25

2 release files

1.0.24

2 release files

1.0.23

2 release files

1.0.22

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.18

2 release files

1.0.17

2 release files

1.0.16

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.20

2 release files

0.2.19

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page