When calling inet_client_addr()
on an Amazon Aurora PostgreSQL Serverless v2, the IP address returned is not the one actually used by the client.
In my scenario, I connect from an IP address 10.40.x.x in my VPC to the database endpoint which is resolved to 10.40.y.y. No proxy is involved in my setup (i.e. no RDS proxy or a SOCKS proxy).
When I call inet_client_addr()
, the returned IP address is different (10.1.z.z) which is not within any CIDR of any VPC in my account (no VPC peering connections exist either).
I get the same result when I select * from pg_stat_activity
: the client_addr
column lists the same wrong private IP address. This applies to all client connections to the RDS cluster.
Is there some kind of misconfiguration on my part that I should look into? Why don’t I get the actual IP addresses of my clients when they connect to the cluster?