-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a cross account supported way of sending slack notifications whenever GraphQl mesh is deployed
- Loading branch information
Showing
4 changed files
with
167 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { PublishCommand, SNSClient } from '@aws-sdk/client-sns'; | ||
import { SNSEvent } from 'aws-lambda'; | ||
|
||
const client = new SNSClient({ region: process.env.AWS_REGION }); | ||
|
||
export const handler = async (event: SNSEvent): Promise<void> => { | ||
const record = event.Records[0]; | ||
const message = record.Sns.Message; | ||
|
||
const command = new PublishCommand({ | ||
TopicArn: process.env.SNS_TOPIC, | ||
Message: message, | ||
}); | ||
|
||
try { | ||
await client.send(command); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
}; |
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