AWS Lambda for Slack Notification
Deploy a Slack webhook Lambda function.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-ts-lambda-slackcd pulumi-examples/aws-ts-lambda-slackA Pulumi example to:
- Creates an AWS Lambda function to post a message on Slack via a Webhook URL.
- Adds an AWS API Gateway so the Lambda can be invoked externally, e.g, via GitHub Webhooks.
- Uses a Pulumi ESC Environment to dynamically retrieve AWS OIDC Credentials and the Slack URL from AWS Secrets Manager.
Last update: September 2024
📋 Pre-requisites#
- AWS OIDC configured in an Pulumi ESC Environment
- AWS Secrets Manager with a Slack Webhook URL secret
- A properly configured Slack Webhook URL
- Pulumi CLI
- Pulumi Cloud account
- npm
👩🏫 Get started#
This Pulumi example is written as a template. It is meant to be copied via pulumi new
# login to your Pulumi Cloud if you haven't alreadypulumi login
# create a new dir and cd to itmkdir my-slack-democd my-slack-demo
# start your pulumi projectpulumi new https://github.com/pulumi/examples/aws-ts-lambda-slack# Add your Pulumi ESC Environmentpulumi config env add YOUR_ESC_ENV --yes --non-interactivepulumi up# select 'yes' to confirm the expected changes# 🎉 Ta-Da!🧹 Clean up#
To clean up your infrastructure, run:
pulumi destroy# select 'yes' to confirm the expected changesRelated
ExampleTypeScript
Building and bundling Lambda dependencies
ExampleTypeScript