-
Notifications
You must be signed in to change notification settings - Fork 5
/
lambda_alarm.tf
30 lines (26 loc) · 879 Bytes
/
lambda_alarm.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Module
data "aws_s3_bucket_object" "lambda_alarms" {
bucket = var.s3_bucket
key = "lambda-alarms.zip"
}
module "lambda_alarms" {
source = "ggit@github.com:DanielDaCosta/lambda-module.git"
lambda_name = var.lambda_alarms_discord
s3_bucket = var.s3_bucket
s3_key = "lambda-alarms.zip"
s3_object_version = data.aws_s3_bucket_object.lambda_alarms.version_id
environment = var.environment
name = var.name
description = "Send Alerts to Discord"
role = data.aws_iam_role.lambda_exec_role.arn
runtime = "python3.7"
environment_variables = {
WEBHOOK_URL = "WEBHOOK_IN_HERE"
}
allowed_triggers = {
AllowExecutionFromSNS = {
service = "sns"
source_arn = data.aws_sns_topic.sns_alarms.arn
}
}
}