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

Updated log-group-connector sam version to 1.0.14 and added support for AutoSubscribeLogGroupByTags #211

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions aws-observability-terraform/source-module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ module "cloudwatch_logs_lambda_log_forwarder_module" {
}

auto_enable_logs_subscription = var.auto_enable_logs_subscription
app_semantic_version = "1.0.12"
app_semantic_version = "1.0.14"
auto_enable_logs_subscription_options = {
filter = var.auto_enable_logs_subscription_options.filter
}
Expand Down Expand Up @@ -259,7 +259,7 @@ module "kinesis_firehose_for_logs_module" {
}

auto_enable_logs_subscription = var.auto_enable_logs_subscription
app_semantic_version = "1.0.12"
app_semantic_version = "1.0.14"
auto_enable_logs_subscription_options = {
filter = var.auto_enable_logs_subscription_options.filter
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Parameters:
Type: String
Default: '\/aws\/(lambda|apigateway|rds)'
Description: "Enter regex for matching logGroups. Regex will check for the name. Visit https://help.sumologic.com/docs/send-data/collect-from-other-data-sources/autosubscribe-arn-destination/#configuringparameters"
AutoSubscribeLogGroupByTags:
Type: String
Default: ""
Description: "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"
AutoSubscribeRoleArn:
Type: String
Default: ""
Expand Down Expand Up @@ -154,10 +158,11 @@ Resources:
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-loggroup-connector
SemanticVersion: 1.0.12
SemanticVersion: 1.0.14
Parameters:
DestinationArnType: !Ref AutoSubscribeDestinationARNType
DestinationArnValue: !Ref AutoSubscribeDestinationARN
LogGroupPattern: !Ref AutoSubscribeLambdaLogGroupPattern
LogGroupTags: !Ref AutoSubscribeLogGroupByTags
UseExistingLogs: !If [auto_subscribe_exisitng_log_groups, "true", "false"]
RoleArn: !Ref AutoSubscribeRoleArn
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ Resources:
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-loggroup-connector
SemanticVersion: 1.0.12
SemanticVersion: 1.0.14
Parameters:
DestinationArnType: "Lambda"
DestinationArnValue: !GetAtt CloudWatchEventFunction.Outputs.SumoCWLogsLambdaArn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ Resources:
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:956882708938:applications/sumologic-loggroup-connector
SemanticVersion: 1.0.12
SemanticVersion: 1.0.14
Parameters:
DestinationArnType: "Lambda"
DestinationArnValue: !GetAtt CloudWatchEventFunction.Outputs.SumoCWLogsLambdaArn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- Section7bLambdaCloudWatchLogsSourceUrl
- Section7cAutoSubscribeLogGroupsOptions
- Section7dAutoSubscribeLogGroupPattern
- Section7eAutoSubscribeLogGroupByTags

- Label:
default: "8. Sumo Logic Root Cause Explorer Sources"
Expand Down Expand Up @@ -134,6 +135,9 @@
default: "Subscribe log groups to Destination (Lambda or kinesis firehose delivery stream)"
Section7dAutoSubscribeLogGroupPattern:
default: "Regex for filtering CloudWatch Log Groups. If you want to collect from all CloudWatch Log Groups use .*"
Section7eAutoSubscribeLogGroupByTags:
default: "Tags for filtering CloudWatch Log Groups."


Section8aRootCauseExplorerOptions:
default: "Select the Sumo Logic Root Cause Explorer Sources"
Expand Down Expand Up @@ -324,6 +328,10 @@
Type: String
Default: '\/aws\/(lambda|apigateway|rds)'
Description: "Enter regex for matching CloudWatch Log groups name. Regex will check for the Log group name. Visit https://help.sumologic.com/03Send-Data/Collect-from-Other-Data-Sources/Auto-Subscribe_AWS_Log_Groups_to_a_Lambda_Function#Configuring_parameters"
Section7eAutoSubscribeLogGroupByTags:
Type: String
Default: ""
Description: "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"

Section8aRootCauseExplorerOptions:
Type: String
Expand Down Expand Up @@ -388,33 +396,33 @@

Conditions:
# Condition for Metrics Source
install_inventory_source: !Or

Check failure on line 399 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'install_inventory_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section8aRootCauseExplorerOptions, 'Inventory Source' ]
- !Equals [ !Ref Section8aRootCauseExplorerOptions, 'Both' ]
install_xray_source: !Or

Check failure on line 402 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'install_xray_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section8aRootCauseExplorerOptions, 'Xray Source' ]
- !Equals [ !Ref Section8aRootCauseExplorerOptions, 'Both' ]

# Conditions for Bucket
create_alb_bucket: !And

Check failure on line 407 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_alb_bucket' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section5bALBCreateLogSource, 'Yes' ]
- !Equals [ !Ref Section5dALBS3LogsBucketName, '' ]

create_cloudtrail_bucket: !And

Check failure on line 411 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_cloudtrail_bucket' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section6aCreateCloudTrailLogSource, 'Yes' ]
- !Equals [ !Ref Section6cCloudTrailLogsBucketName, '' ]

#condition for ELB classic bucket
create_elb_bucket: !And

Check failure on line 416 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_elb_bucket' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section9bELBCreateLogSource, 'Yes' ]
- !Equals [ !Ref Section9dELBS3LogsBucketName, '' ]

# Sources Create Condition
create_cloudtrail_source: !Equals [ !Ref Section6aCreateCloudTrailLogSource, 'Yes' ]

Check failure on line 421 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_cloudtrail_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
create_alb_source: !Equals [ !Ref Section5bALBCreateLogSource, 'Yes' ]

Check failure on line 422 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_alb_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
create_kf_metrics_source: !Equals [ !Ref Section4aCreateMetricsSourceOptions, 'Kinesis Firehose Metrics Source' ]

Check failure on line 423 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_kf_metrics_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
create_cw_metrics_source: !Equals [ !Ref Section4aCreateMetricsSourceOptions, 'CloudWatch Metrics Source' ]

Check failure on line 424 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_cw_metrics_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
create_kf_logs_source: !Or

Check failure on line 425 in aws-observability/templates/sumologic_observability.master.template.yaml

View workflow job for this annotation

GitHub Actions / Validatation (cfn-lint)

E8001 'create_kf_logs_source' does not match any of the regexes: '^[a-zA-Z0-9&]{1,255}$'
- !Equals [ !Ref Section7aLambdaCreateCloudWatchLogsSourceOptions, 'Kinesis Firehose Log Source' ]
- !Equals [ !Ref Section7aLambdaCreateCloudWatchLogsSourceOptions, 'Both (Switch from Lambda Log Forwarder to Kinesis Firehose Log Source)' ]
create_cw_logs_source: !Or
Expand Down Expand Up @@ -475,7 +483,7 @@
CommonData:
NestedTemplate:
BucketName: "sumologic-appdev-aws-sam-apps"
Version: "v2.10.0"
Version: "v2.11.0"
CollectorDetails:
SumoLogicAccountID: 926226587429
CollectorNamePrefix: "aws-observability"
Expand Down Expand Up @@ -627,7 +635,7 @@
scanInterval: 60
ToUpdate:
Fn::Base64: !Sub
- "${a}-${b}-${c}-${d}-${e}-${f}-${g}-${h}-${i}-${j}-${k}-${l}-${m}-${n}-${o}-${p}-${q}-${r}-${s}-${t}-${u}-${v}"
- "${a}-${b}-${c}-${d}-${e}-${f}-${g}-${h}-${i}-${j}-${k}-${l}-${m}-${n}-${o}-${p}-${q}-${r}-${s}-${t}-${u}-${v}-${w}"
- a: !Ref Section2aAccountAlias
b: !Ref Section3aInstallObservabilityApps
c: !Ref Section4aCreateMetricsSourceOptions
Expand All @@ -644,12 +652,13 @@
n: !Ref Section7bLambdaCloudWatchLogsSourceUrl
o: !Ref Section7cAutoSubscribeLogGroupsOptions
p: !Ref Section7dAutoSubscribeLogGroupPattern
q: !Ref Section9aAutoEnableS3LogsELBResourcesOptions
r: !Ref Section9bELBCreateLogSource
s: !Ref Section9cELBLogsSourceUrl
t: !Ref Section9dELBS3LogsBucketName
u: !Ref Section10aAppInstallLocation
v: !FindInMap [CommonData, NestedTemplate, Version]
q: !Ref Section7eAutoSubscribeLogGroupByTags
r: !Ref Section9aAutoEnableS3LogsELBResourcesOptions
s: !Ref Section9bELBCreateLogSource
t: !Ref Section9cELBLogsSourceUrl
u: !Ref Section9dELBS3LogsBucketName
v: !Ref Section10aAppInstallLocation
w: !FindInMap [CommonData, NestedTemplate, Version]

CreateCommonResources:
Type: AWS::CloudFormation::Stack
Expand Down Expand Up @@ -729,6 +738,7 @@
AutoSubscribeDestinationARNType: !If [create_kf_logs_source, "Kinesis", "Lambda" ]
AutoSubscribeDestinationARN: !If [create_kf_logs_source, !GetAtt CreateCommonResources.Outputs.KinesisLogsDeliveryStreamARN, !If [ create_cw_logs_source, !GetAtt CreateCommonResources.Outputs.CloudWatchLambdaARN, "" ] ]
AutoSubscribeLambdaLogGroupPattern: !Ref Section7dAutoSubscribeLogGroupPattern
AutoSubscribeLogGroupByTags: !Ref Section7eAutoSubscribeLogGroupByTags
AutoSubscribeRoleArn: !If [create_kf_logs_source, !GetAtt CreateCommonResources.Outputs.KinesisLogsRoleARN, "" ]
ELBAutoEnableS3Logs: !If [auto_enable_s3_logs_elb, "Yes", "No"]
ELBAutoEnableS3LogsOptions: !Ref Section9aAutoEnableS3LogsELBResourcesOptions
Expand Down
Loading