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

Issue: QnABot logs Never Expire. Request: Add configurable log retention period for all CloudWatch log groups used by QnABot #738

Open
rstrahan opened this issue Jun 5, 2024 · 2 comments
Assignees

Comments

@rstrahan
Copy link
Contributor

rstrahan commented Jun 5, 2024

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

QnABot Lambda functions currently log to implicitly created CloudWatch log groups that default to 'Never Expire' - eg

image

This is problematic:

  1. as logs grow over time, incurring increasing cost
  2. logs may contain sensitive information from QnAbot requests that needs to be deleted after some days for policy compliance and to prevent legal liability / discoverability issues.

Describe the feature you'd like
A clear and concise description of what you want to happen.

  1. QnABot main template should have a new parameter for CloudWatch logs retention period in days (with a default - say 30 days)
  2. All QnABot templates should be modified to explicitly create a CloudWatch log group for each Lambda function
    • with an explicitly named log group based on the stack name for easier discovery
    • with an explicitly set retention

eg something like this..

  LambdaXXXLogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName:
        Fn::Sub: /${AWS::StackName}/lambda/LambdaXXX
      RetentionInDays:
        Ref: CloudWatchLogsExpirationInDays

and each associated Lambda function should reference it's explicit log group by adding the LoggingConfig property:

      LoggingConfig:
        LogGroup:
          Fn::Sub: /${AWS::StackName}/lambda/LambdaXXX

Additional context
Add any other context or screenshots about the feature request here.

@ajaysw
Copy link

ajaysw commented Jun 6, 2024

Thank you @rstrahan - we will add this to the backlog and prioritize.

@fhoueto-amz
Copy link
Member

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants