Aws: connection to postgres keep timing out

I am trying to demo grafana to my team.
I am spinning a new DB on amazon (using postgres) and I am able to populate it with data from my sql client.

But I cannot connect to it from Grafana.
I tried a bunch of different configurations.

Couldn’t decide if this is the same case as other topics opened here.

I am at a loss… really need this to work.
Sounds to me like a basic scenario that should work out of the box.
Is there any special AWS configurations I should apply? Not really familiar with AWS.

Just to clarify - I do “save & test” on the datasource and the test fails after a LONG time with timeout.
I have used grafana with AWS previously without problems, but this is the first I am setting up the DB as well.

Ok, I found out each DB gets a security group.
BUT - someone please explain to me… I was able to run code on my machine to populate it, and connect with SQL clients…

Why did Grafana fail to connect to it? Right now I allowed everyone to connect (did security group inbound anywhere rule).

But I would really like some explanation why Grafana was the only one not able to connect to the instance.