Skip to content

Commit 6083a1d

Browse files
committed
CCM-9868: Adding subfilter for lambda logs
1 parent 344a038 commit 6083a1d

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "aws_cloudwatch_log_subscription_filter" "amplify" {
2+
count = var.send_to_firehose ? 1 : 0
3+
name = replace(aws_cloudwatch_log_group.main.name, "/", "-")
4+
log_group_name = aws_cloudwatch_log_group.main.name
5+
filter_pattern = var.filter_pattern
6+
destination_arn = var.destination_arn
7+
role_arn = var.log_subscription_log_role_arn
8+
}

infrastructure/modules/lambda/variables.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,27 @@ variable "lambda_at_edge" {
212212
description = "Enable the lambda insights layer, this must be disabled for lambda@edge usage"
213213
default = false
214214
}
215+
216+
variable "send_to_firehose" {
217+
type = bool
218+
description = "Enable sending logs to firehose"
219+
default = false
220+
}
221+
222+
variable "filter_pattern" {
223+
type = string
224+
description = "Filter pattern to use for the log subscription filter"
225+
default = ""
226+
}
227+
228+
variable "destination_arn" {
229+
type = string
230+
description = "Destination ARN to use for the log subscription filter"
231+
default = ""
232+
}
233+
234+
variable "log_subscription_log_role_arn" {
235+
type = string
236+
description = "The ARN of the IAM role to use for the log subscription filter"
237+
default = ""
238+
}

0 commit comments

Comments
 (0)