As per AWS documentation for RDS -
Publishing database logs to Amazon CloudWatch Logs
In addition to viewing and downloading DB instance logs, you can publish logs to Amazon CloudWatch Logs. With CloudWatch Logs, you can perform real-time analysis of the log data, store the data in highly durable storage, and manage the data with the CloudWatch Logs Agent. AWS retains log data published to CloudWatch Logs for an indefinite time period unless you specify a retention period.
I have two questions
I am trying to figure out how to set the retention period in terraform The terraform syntax for DbInstance doesn't seem to have parameter for setting a custom log group name
What is the best practice for the RDS database logs , I am assuming the logs should be archived in S3 after certain period using S3 lifecycle rules ? Is that correct ? How to accomplish that using Terraform
I was unable to find anything on internet for this topic. Any help is really appreciated.