A company has a compliance requirement to retain all system logs for exactly 90 days. A SysOps Administrator is auditing the current logging configuration and discovers several Amazon CloudWatch log groups with their retention periods set to 'Never expire'. The administrator wants to ensure that all current and future logs in these log groups are deleted after 90 days. Which action should the administrator take to meet this requirement?
- Modify the retention settings directly on each CloudWatch log group to 90 days.Cevap
- BModify the retention settings on each individual log stream within the log groups to 90 days.
- CCreate an Amazon EventBridge rule that triggers an AWS Systems Manager Automation document to scan and delete log streams older than 90 days.
- DApply an Amazon S3 Lifecycle policy with an expiration rule of 90 days directly to the CloudWatch log groups.
Cevap
Modify the retention settings directly on each CloudWatch log group to 90 days.
Modifying the retention settings at the log group level is the standard and most efficient way to manage log expiration in Amazon CloudWatch. CloudWatch Logs automatically deletes log events older than the specified retention period for all streams within that log group.
Adım Adım Çözüm
Anahtar Kavram
CloudWatch Logs retention policy configuration