Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for auto subscribe log group by tags #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
26 changes: 13 additions & 13 deletions aws/cloudwatchlogsforwarder/README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions aws/cloudwatchlogsforwarder/cloudwatchlogsforwarder.tf
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ resource "aws_serverlessapplicationrepository_cloudformation_stack" "auto_enable
DestinationArnType = "Lambda"
DestinationArnValue = aws_lambda_function.logs_lambda_function.arn
LogGroupPattern = var.auto_enable_logs_subscription_options.filter
LogGroupTags = var.auto_enable_logs_subscription_options.tags_filter
UseExistingLogs = local.auto_enable_existing
}
}
3 changes: 2 additions & 1 deletion aws/cloudwatchlogsforwarder/examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ module "cloudwatch_logs_lambda_log_forwarder_module" {
}

auto_enable_logs_subscription = "Both"
app_semantic_version = "1.0.11"
app_semantic_version = "1.0.14"
auto_enable_logs_subscription_options = {
filter = "lambda|rds"
tags_filter = ""
}
}

Expand Down
9 changes: 6 additions & 3 deletions aws/cloudwatchlogsforwarder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ variable "source_details" {
variable "app_semantic_version" {
type = string
description = "Provide the latest version of Serverless Application Repository 'sumologic-loggroup-connector'."
default = "1.0.11"
default = "1.0.14"
}

variable "auto_enable_logs_subscription" {
Expand All @@ -103,14 +103,17 @@ variable "auto_enable_logs_subscription" {
variable "auto_enable_logs_subscription_options" {
type = object({
filter = string
tags_filter = string
})

description = <<EOT
filter - Enter regex for matching logGroups. Regex will check for the name. Visit https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Auto-Subscribe_AWS_Log_Groups_to_a_Lambda_Function#Configuring_parameters
filter - Enter regex for matching logGroups. Regex will check for the name.
tags_filter - Enter comma separated key value pairs for filtering logGroups using tags. Ex KeyName1=string,KeyName2=string. This is optional leave it blank if tag based filtering is not needed.
Visit https://help.sumologic.com/docs/send-data/collect-from-other-data-sources/autosubscribe-arn-destination/#configuringparameters
EOT

default = {
filter = "lambda"
tags_filter = ""
}
}

20 changes: 10 additions & 10 deletions aws/kinesisfirehoseforlogs/README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion aws/kinesisfirehoseforlogs/examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ module "kinesis_firehose_for_logs_module" {
}

auto_enable_logs_subscription = "Both"
app_semantic_version = "1.0.11"
app_semantic_version = "1.0.14"
auto_enable_logs_subscription_options = {
filter = "lambda|rds"
tags_filter = ""
}
}
1 change: 1 addition & 0 deletions aws/kinesisfirehoseforlogs/kinesisfirehoseforlogs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ resource "aws_serverlessapplicationrepository_cloudformation_stack" "auto_enable
DestinationArnType = "Kinesis"
DestinationArnValue = aws_kinesis_firehose_delivery_stream.logs_delivery_stream.arn
LogGroupPattern = var.auto_enable_logs_subscription_options.filter
LogGroupTags = var.auto_enable_logs_subscription_options.tags_filter
UseExistingLogs = local.auto_enable_existing
RoleArn = aws_iam_role.logs_role.arn
}
Expand Down
9 changes: 6 additions & 3 deletions aws/kinesisfirehoseforlogs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ variable "source_details" {
variable "app_semantic_version" {
type = string
description = "Provide the latest version of Serverless Application Repository 'sumologic-loggroup-connector'."
default = "1.0.11"
default = "1.0.14"
}

variable "auto_enable_logs_subscription" {
Expand All @@ -81,14 +81,17 @@ variable "auto_enable_logs_subscription" {
variable "auto_enable_logs_subscription_options" {
type = object({
filter = string
tags_filter = string
})

description = <<EOT
filter - Enter regex for matching logGroups. Regex will check for the name. Visit https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Auto-Subscribe_AWS_Log_Groups_to_a_Lambda_Function#Configuring_parameters
filter - Enter regex for matching logGroups. Regex will check for the name.
tags_filter - Enter comma separated key value pairs for filtering logGroups using tags. Ex KeyName1=string,KeyName2=string. This is optional leave it blank if tag based filtering is not needed.
Visit https://help.sumologic.com/docs/send-data/collect-from-other-data-sources/autosubscribe-arn-destination/#configuringparameters
EOT

default = {
filter = "lambda"
tags_filter = ""
}
}

Loading