I have followed these steps to connect RDS Proxy to connect RDS from lambda
https://aws.amazon.com/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/
Whenever I'm running in lambda, it's connecting but later whenever we execute query it will disconnect by showing this message
FATAL: RDS Proxy supports only IAM or MD5 authentication.
While troubleshooting
1)I have added AmazonRDSDataFullAccess to role.
2)I have added below one's also to policy
{
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:eu-west-1:[acct-id]:key/*",
"Condition": {
"StringEquals": {
"kms:ViaService": "secretsmanager.eu-west-1.amazonaws.com"
}
}
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:ue-west-1:[acct-id]:dbuser:prx-ABCDEFGHIJKL01234/*"
]
}
]
}
3)Created a new read-write role within my actual RDS instance same as IAM name
4)Only thing is that I couldn't create DefaultEncryptionKey instead I was getting my secret key only to select
export PGPASSWORD="$(aws rds generate-db-auth-token --hostname ${host} --port 5432 --region eu-west-1 --username iamuser)"
psql -h ${host} -p 5432 -d postgres -U iamuser
psql (14.4, server 13.4)
SSL connection (protocol: TLSv1.3, cipher:***, bits: 256, compression: off)
Type "help" for help.
postgres=> select current_user;
FATAL: RDS Proxy supports only IAM or MD5 authentication
SSL connection has been closed unexpectedly
The connection to the server was lost. Attempting reset: Succeeded.
psql (14.4, server 13.4)
SSL connection (protocol: TLSv1.3, cipher: ***, bits: 256, compression: off)