Skip to content

Commit

Permalink
Integrated new sam 'log-group-connector' to support auto subscribe lo…
Browse files Browse the repository at this point in the history
…g group by tags
  • Loading branch information
akhil-sumologic committed Sep 19, 2024
1 parent 17e7028 commit c7c47b1
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 29 deletions.
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
7 changes: 5 additions & 2 deletions aws/cloudwatchlogsforwarder/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 5 additions & 2 deletions aws/kinesisfirehoseforlogs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
}

0 comments on commit c7c47b1

Please sign in to comment.