aws-solutions / quota-monitor-for-aws

This solution leverages AWS Trusted Advisor and Service Quotas to monitor AWS resource usage and raise alerts.
Other
434 stars 116 forks source link

SQS Queue (QMReporterQMReporterLambda) is flushed with messages #146

Closed jurgen-kamp closed 1 year ago

jurgen-kamp commented 1 year ago

Describe the bug

The QMReporterQMReporterLambda is being flushed with messages as the lambda function can handle a maximum of 100 messages (10 MAX_MESSAGES x 10 MAX_LOOPS)

abewub commented 1 year ago

Thanks for reporting, those values are environment variables (with default values of 10) to the lambda function. You can edit them to a more appropriate value for your deployment size. It could be a good idea to expose as template parameters. That lambda is invoked every 5 minutes by default, that could also be changed.

jurgen-kamp commented 1 year ago

Thank you for your response. I got an InvalidParameterValue error when changing the environment variable higher that 10. Error: "InvalidParameterValue - Value 20 for parameter MaxNumberOfMessages is invalid. Reason: Must be between 1 and 10, if provided."

(I also changed the EventBridge Rule to 1 minute.)

abewub commented 1 year ago

Thanks for pointing that out, Receive message is limited to the 10. So you can only increase the number of loops (MAX_LOOPS). We will include this in the documentation in the next release.

jurgen-kamp commented 1 year ago

Thank for this fix. Do you maybe know what the maximum value of MAX_LOOPS is?

abewub commented 1 year ago

There is no hard limit. But at some point, the lambda function will probably run out of memory. Then you can increase the memory allocation.

abewub commented 1 year ago

Documentation updated