Sign in to the AWS Console and go to the AWS RDS Console.
In the RDS Dashboard, click on Databases.
Select Modify to modify the instance of your choice.
From the Log exports section, select the log types that you want to publish.
In Terraform -
In the aws_db_instance, configure an enabled_cloudwatch_logs_exports list.
There are several log types that can be included, but each is dependent on the database engine. For specific field options, see the Terraform documentation.