A discord notification triggered by codepipeline, using SNS and AWS Lambda.
Follow this tutorial to get Discord Token: link
Follow this tutorial to get Discord Webhook url: link
Clone this repo
git clone https://github.com/chnacib/discord-codepipeline.git
cd discord-codepipeline/module
Edit terrafile.tf
and replace variables in module
module "lambda_sns" {
source = "../"
region = "us-east-1"
account_id = "01234567890"
token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
url = "https://discord.com/api/v9/channels/xxxxxxxxxxxx/messages"
function_name = "sample-function"
topic_name = "sample-topic"
}
Deploy terraform module
terraform init
terraform apply -auto-approve
Name | Version |
---|---|
aws | n/a |
Name | Source | Version |
---|---|---|
lambda_sns | ../ | n/a |
Name | Type |
---|---|
aws_iam_role.iam_for_lambda | resource |
aws_iam_role_policy_attachment.basic | resource |
aws_lambda_function.main | resource |
aws_lambda_layer_version.lambda_layer | resource |
aws_lambda_permission.with_sns | resource |
aws_sns_topic.topic | resource |
aws_sns_topic_policy.topic_policy | resource |
aws_sns_topic_subscription.user_updates_sqs_target | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
account_id | AWS Account ID | string |
n/a | yes |
function_name | AWS Lambda function name | string |
n/a | yes |
region | AWS region | string |
n/a | yes |
token | Discord account token | string |
n/a | yes |
topic_name | SNS Topic name | string |
n/a | yes |
url | Discord Webhook URL | string |
n/a | yes |