I try to give my EC2 instance access to my AWS RDS Postgresql database via IAM.
First, I've created a policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds:connect"
],
"Resource": [
"arn:aws:rds:eu-west-1:824224273455:db:instance-name/db-name"
]
}
]
}
After that I attached this policy to a role
, which I attached to this specific EC2-instance. Everything seems to be fine till now.
When ssh to that specific EC2 instance and try to connect to the database, psql
still prompts for a password.
Anyone knows how to accomplish it that I can connect without needing to use a password?