Migrate DB via CircleCI test & build pipeline to AWS RDS

We are trying to set up an automated pipeline in CircleCI to manage migrations for an AWS RDS instance using Alembic. Despite configuring jobs in .circleci/config.yml for building, testing database connectivity, and applying migrations, we consistently encounter connection timeout errors. We have configured environment variables, set up AWS Security Groups to allow CircleCI IP ranges, and ensured credentials are available in CircleCI, yet the migrations fail due to connectivity issues. We are looking for documentation or guidance on properly configuring CircleCI, AWS Security Groups, environment variables, and Alembic so that migrations can run seamlessly without manual intervention or connectivity problems.