Connection problem to external database server aws RDS

Hello everyone, this is my first post on the forum.

I have recently installed OpenEdX with tutor, all good.

But I want to be able to separate the mysql database from the main server to an external aws RDS server, my main server is an ec2 instance, the access policies are those recommended by aws marketplace.

The problem I have is that there is no ping between my OpenEdX server and the database server, although they are in the same vpc, but from my local pc if I can access the database, I do not understand why it is not working I have tried everything and it does not connect, I hope you can give me a hand in this regard.