Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding slack webhook lambda #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
456 changes: 448 additions & 8 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ members = [
"delete-unnused-aws-loggroups",
"export-loggroups-to-s3",
"rotate-google-service-user",
"slack-webhook-to-eventbridge",
]
32 changes: 32 additions & 0 deletions slack-webhook-to-eventbridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "slack-webhook-to-eventbridge"
version = "1.0.0"
authors = ["Marc Mettke <[email protected]>"]
edition = "2021"
description = "WebAPI Lambda compatible with Slack Webhook. Expects a Slack event and sends it to EventBridge"
license = "MIT OR Apache-2.0"
repository = "https://github.com/itmettkeDE/lambdas"
readme = "./README.md"
keywords = ["lambda", "slack", "webhook", "eventbridge"]
categories = ["command-line-utilities"]

[features]
test = ["lambda-runtime-types/test"]

[dependencies]
anyhow = "1"
async-trait = "0.1"
aws-config = { version = "0.9", features = ["rustls"] }
aws-sdk-eventbridge = { version = "0.9", features = ["rustls"] }
aws-sdk-secretsmanager = { version = "0.9", features = ["rustls"] }
hex = "0.4"
hmac = "0.12"
http = "0.2"
http-serde = "1"
lambda-runtime-types = { version = "0.6", default-features = false, features = ["rotate_rusoto"] }
log = "0.4"
query_map = { version = "0.4", features = ["serde"] }
sha2 = "0.10"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
simple_logger = "2"
29 changes: 29 additions & 0 deletions slack-webhook-to-eventbridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# slack-webhook-to-eventbridge

This Lambda is compatible with AWS WebAPI. Its supposed to be connected to the Slack Event Subscription and will send incoming Slack Events to EventBridge.

## Setup

* Create a lambda with the binary from this repository using runtime `provided.al2`
and anything as handler. (More Infos about paramters below).
* Add permissions for `secretsmanager:GetSecretValue` and `events:PutEvents` to the
lambdas iam role

## Parameters

The lambda function has a few parameters. You can define them via
environment variables.

### Environment Variables
```sh
# AWS Secretsmanager Secret which contains the signing_secret in the following format:
# `{"signing_secret": ""}`
SLACK_SECRET=""
# Name of the AWS Eventbridge this lambda is supposed to send events to
EVENTBRIDGE_BUS_NAME=""
# Optional, skip if not required. off | error | warn | info (default) | debug | trace
# Defines the log level
LOG_LEVEL=""
```

License: MIT OR Apache-2.0
Loading