Skip to content
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
14 changes: 7 additions & 7 deletions awsautoenableS3Logging/packaged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Metadata:
- s3logging
- flowlogs
Name: sumologic-s3-logging-auto-enable
SemanticVersion: 1.0.18
SemanticVersion: 1.0.19
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/awsautoenableS3Logging
LicenseUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.18/978602b5b9ec16f8bab0e38fd6b3998f
ReadmeUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.18/d05d411471e0bb4db3389f2523f515f0
LicenseUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.19/978602b5b9ec16f8bab0e38fd6b3998f
ReadmeUrl: s3://appdevstore/AutoEnableS3Logs/v1.0.19/d05d411471e0bb4db3389f2523f515f0
SpdxLicenseId: Apache-2.0
Mappings:
Region2ELBAccountId:
Expand Down Expand Up @@ -229,9 +229,9 @@ Resources:
Type: AWS::Serverless::Function
Condition: auto_enable_new
Properties:
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.21/sumo_app_utils.zip
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
Handler: awsresource.enable_s3_logs
Runtime: python3.13
Runtime: python3.14
Comment thread
akhil-sumologic marked this conversation as resolved.
Role:
Fn::GetAtt:
- SumoLambdaRole
Expand Down Expand Up @@ -466,8 +466,8 @@ Resources:
Condition: auto_enable_existing
Properties:
Handler: main.handler
Runtime: python3.13
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.21/sumo_app_utils.zip
Runtime: python3.14
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
MemorySize: 128
Timeout: 900
Role:
Expand Down
10 changes: 5 additions & 5 deletions awsautoenableS3Logging/sumologic-s3-logging-auto-enable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Metadata:
- s3logging
- flowlogs
Name: sumologic-s3-logging-auto-enable
SemanticVersion: 1.0.18
SemanticVersion: 1.0.19
SourceCodeUrl: https://github.com/SumoLogic/sumologic-aws-lambda/tree/main/awsautoenableS3Logging
LicenseUrl: ./LICENSE
ReadmeUrl: ./README.md
Expand Down Expand Up @@ -208,9 +208,9 @@ Resources:
Type: 'AWS::Serverless::Function'
Condition: auto_enable_new
Properties:
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.21/sumo_app_utils.zip
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
Handler: "awsresource.enable_s3_logs"
Runtime: python3.13
Runtime: python3.14
Role: !GetAtt SumoLambdaRole.Arn
Description: "Lambda Function for auto enable s3 logs for AWS Resources."
MemorySize: 128
Expand Down Expand Up @@ -384,8 +384,8 @@ Resources:
Condition: auto_enable_existing
Properties:
Handler: main.handler
Runtime: python3.13
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.21/sumo_app_utils.zip
Runtime: python3.14
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
MemorySize: 128
Timeout: 900
Role:
Expand Down
6 changes: 3 additions & 3 deletions loggroup-lambda-connector/sam/packaged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ Resources:
SumoLogGroupLambdaConnector:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://appdevstore/LoggroupConnector/v1.0.16/1c2a1905b7cc328190497a4582481fb6
CodeUri: s3://appdevstore/LoggroupConnector/v1.0.16/00026b4d91b0d0a89abec3e0cfe43475
Handler: loggroup-lambda-connector.handler
Runtime: nodejs22.x
Runtime: nodejs24.x
Environment:
Variables:
DESTINATION_ARN:
Expand Down Expand Up @@ -202,7 +202,7 @@ Resources:
\ console.log(responseData.Error + \":\\n\", err);\n }\n \n await response.send(event,\
\ context, responseStatus, responseData);\n};\n"
Handler: index.handler
Runtime: nodejs22.x
Runtime: nodejs24.x
Environment:
Variables:
FUNCTION_NAME:
Expand Down
4 changes: 2 additions & 2 deletions loggroup-lambda-connector/sam/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Resources:
Properties:
CodeUri: ../src/
Handler: "loggroup-lambda-connector.handler"
Runtime: nodejs22.x
Runtime: nodejs24.x
Comment thread
akhil-sumologic marked this conversation as resolved.
Environment:
Variables:
DESTINATION_ARN: !Ref "DestinationArnValue"
Expand Down Expand Up @@ -193,7 +193,7 @@ Resources:
await response.send(event, context, responseStatus, responseData);
};
Handler: "index.handler"
Runtime: nodejs22.x
Runtime: nodejs24.x
Environment:
Variables:
FUNCTION_NAME: !Ref SumoLogGroupLambdaConnector
Expand Down
41 changes: 26 additions & 15 deletions loggroup-lambda-connector/src/loggroup-lambda-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,32 +218,43 @@ async function processEvents(env, event, additionalArgs, errorHandler, retryCoun
}
}

exports.handler = async function (event, context, callback) {
exports.handler = async (event, context) => {

const partition = context.invokedFunctionArn?.split(":")?.[1] ?? "aws";

let additionalArgs = {
recordCount: 0,
subscribeCount: 0,
invokeCount: 0,
partition: partition
};

if (event.additionalArgs) {
additionalArgs = event.additionalArgs
additionalArgs = event.additionalArgs;
}

console.log("Invoking Log Group connector function");

function errorHandler(err, msg) {
if (err) {
console.log(err, msg);
callback(err);
} else {
callback(null, "Success");
}
}
if (!process.env.LOG_GROUP_PATTERN || process.env.LOG_GROUP_PATTERN.trim().length === 0) {
console.warn("LOG_GROUP_PATTERN is empty, it will subscribe to all loggroups");
}
if (event.existingLogs == "true") {
await processExistingLogGroups(context, event.token, additionalArgs, errorHandler);
} else {
await processEvents(process.env, event, additionalArgs, errorHandler);
console.error(msg, err);
throw err;
}
Comment on lines 238 to 242
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

errorHandler now throws on error, but processEvents calls errorHandler(err, ...) before checking for throttling and retrying. This makes the retry path unreachable (the throw short-circuits the rest of the catch block). Consider moving the throttling retry logic ahead of calling errorHandler, or make errorHandler not throw for retryable errors so exponential backoff still works.

Copilot uses AI. Check for mistakes.
return "Success";
}

if (!process.env.LOG_GROUP_PATTERN || process.env.LOG_GROUP_PATTERN.trim().length === 0) {
console.warn("LOG_GROUP_PATTERN is empty, it will subscribe to all loggroups");
}

if (event.existingLogs === "true") {
await processExistingLogGroups(context, event.token, additionalArgs, errorHandler);
} else {
await processEvents(process.env, event, additionalArgs, errorHandler);
}

return {
statusCode: 200,
body: "Success"
};
};
2 changes: 1 addition & 1 deletion sumologic-app-utils/packaged_sumo_app_utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: main.handler
Runtime: python3.13
Runtime: python3.14
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
Comment thread
akhil-sumologic marked this conversation as resolved.
MemorySize: 128
Timeout: 300
Expand Down
2 changes: 1 addition & 1 deletion sumologic-app-utils/sumo_app_utils.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Resources:
Type: 'AWS::Serverless::Function'
Properties:
Handler: main.handler
Runtime: python3.13
Runtime: python3.14
CodeUri: s3://appdevstore/sumo_app_utils/v2.0.23/sumo_app_utils.zip
MemorySize: 128
Timeout: 300
Expand Down