-
Notifications
You must be signed in to change notification settings - Fork 465
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
Enforcing CloudWatch log group retention period throughout the AWS Organization #670
Comments
Hello @robertcurcio , For restricting modification of LogGroups, suggest that a SCP is created to restrict modification. Note: Should allow the principals that the solution runs as (AND if you want your own internal automation roles to have this ability). Correct, there is a custom resource that modifies new log groups, there is also another custom resource which modifies existing log groups. Lines 1099 to 1110 in 26e8805
It is important to note, for log groups: the code will not update the log groups if the existing retention is longer than the default retention - ie in summary, the higher retention wins Lines 161 to 177 in 4bb52f6
|
Is your feature request related to a problem? Please describe.
We would like to enforce the CloudWatch Log retention period throughout the AWS Organization. We have a lot of older CloudWatch log groups that have to be manually modified when we change our global retention settings.
I can see the AWS Lambda function in every account "AWSAccelerator-LoggingSta-NewCloudWatchLogsCreate" adds the our global retention policy onto newly created CloudWatch log groups. This function is triggered by the event bridge rule "CreateLogGroup" from CloudTrail. Unfortunately, it does not modify existing log groups.
Describe the feature you'd like
A new event bus rule which triggers AWSAccelerator-LoggingSta-NewCloudWatchLogsCreate when it sees PutRetentionPolicy . This allows log group retention policy modifications by an AWS engineer to be reverted back to the global config.
A scheduled job running periodically triggering function "AWSAccelerator-LoggingSta-NewCloudWatchLogsCreate" to find and remediates modified out of scope retention policies, and revers them back to the Global configuration
The text was updated successfully, but these errors were encountered: