Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lambda_function/lambda_function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_cloudwatch_log_group" "lambda_log_group" {

resource "aws_cloudwatch_log_subscription_filter" "example_subscription_filter" {
count = var.ship_logs_to_sumo ? 1 : 0
name = "${var.function_name}_subscription_filter"
name = coalesce(var.subscription_filter_name, "${var.function_name}_subscription_filter")
log_group_name = aws_cloudwatch_log_group.lambda_log_group.name
destination_arn = "arn:aws:lambda:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:function:SumoCWLogsLambda"
filter_pattern = ""
Expand Down
8 changes: 7 additions & 1 deletion lambda_function/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ variable "log_skip_destroy" {
description = "If true, the log group will not be destroyed when the lambda is destroyed"
}

variable "subscription_filter_name" {
type = string
default = null
description = "Optional override for the CloudWatch Logs subscription filter name"
}

variable "ship_logs_to_sumo" {
type = bool
default = false
Expand All @@ -194,4 +200,4 @@ variable "log_tags" {
type = map(string)
default = {}
description = "Tags to apply to the log group. Defaults to the same tags as the lambda function if nothing is passed in."
}
}