-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathmain.tf
48 lines (40 loc) · 1.72 KB
/
main.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module "source" {
source = "../fixtures"
}
module "lambda" {
source = "../../"
cloudwatch_logs_retention_in_days = 14
description = "Example usage for an AWS Lambda with a CloudWatch logs subscription filter."
filename = module.source.output_path
function_name = "example-without-cloudwatch-logs-subscription"
handler = "index.handler"
runtime = "nodejs22.x"
source_code_hash = module.source.output_base64sha256
cloudwatch_log_subscription_filters = {
lambda_1 = {
//see https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_subscription_filter for available arguments
destination_arn = module.destination_1.arn // required
}
lambda_2 = {
destination_arn = module.destination_2.arn // required
}
}
}
module "destination_1" {
source = "../../"
cloudwatch_logs_retention_in_days = 1
filename = module.source.output_path
function_name = "cloudwatch-logs-subscription-destination-1"
handler = "index.handler"
runtime = "nodejs22.x"
source_code_hash = module.source.output_base64sha256
}
module "destination_2" {
source = "../../"
cloudwatch_logs_retention_in_days = 1
filename = module.source.output_path
function_name = "cloudwatch-logs-subscription-destination-2"
handler = "index.handler"
runtime = "nodejs22.x"
source_code_hash = module.source.output_base64sha256
}