-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08a1d76
commit d295a64
Showing
4 changed files
with
80 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
themes/default/content/registry/packages/aws/how-to-guides/aws-ts-lambda-slack.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
title: "AWS Lambda for Slack Notification | TypeScript" | ||
h1: "AWS Lambda for Slack Notification" | ||
linktitle: "AWS Lambda for Slack Notification" | ||
meta_desc: "AWS Lambda for Slack Notification How-to Guide using TypeScript" | ||
no_edit_this_page: true | ||
cloud: aws | ||
language: ts | ||
layout: package | ||
--- | ||
|
||
<!-- WARNING: this page was generated by a tool. Do not edit it by hand. --> | ||
<!-- To change it, please see https://github.com/pulumi/registry/tree/master/tools/mktutorial. --> | ||
|
||
<p class="mb-4 inline-flex items-center"> | ||
<a class="rounded-md font-display text-lg text-white bg-white border-2 border-blue-600 px-3 mr-2 whitespace-no-wrap hover:text-white" style="height: 45px; line-height: 41px;" href="https://github.com/pulumi/examples/tree/master/aws-ts-lambda-slack" target="_blank"> | ||
<span class="flex items-center"> | ||
<i class="fab fa-github pr-1.5"></i> | ||
<span>View Code</span> | ||
</span> | ||
</a> | ||
</p> | ||
|
||
|
||
A 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](https://www.pulumi.com/docs/get-started/install/) | ||
- [Pulumi Cloud account](https://app.pulumi.com/signup) | ||
- [npm](https://www.npmjs.com/get-npm) | ||
|
||
## 👩🏫 Get started | ||
|
||
This Pulumi example is written as a template. It is meant to be copied via `pulumi new` | ||
|
||
```bash | ||
# login to your Pulumi Cloud if you haven't already | ||
$ pulumi login | ||
|
||
# create a new dir and cd to it | ||
$ mkdir my-slack-demo | ||
$ cd my-slack-demo | ||
|
||
# start your pulumi project | ||
$ pulumi new https://github.com/pulumi/examples/aws-ts-lambda-slack | ||
``` | ||
|
||
```bash | ||
# Add your Pulumi ESC Environment | ||
$ pulumi config env add YOUR_ESC_ENV --yes --non-interactive | ||
$ pulumi up | ||
# select 'yes' to confirm the expected changes | ||
# 🎉 Ta-Da! | ||
``` | ||
|
||
## 🧹 Clean up | ||
|
||
To clean up your infrastructure, run: | ||
|
||
```bash | ||
$ pulumi destroy | ||
# select 'yes' to confirm the expected changes | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters