'Accessing heroku private space database over AWS VPC peering connection

I've successfully setup VPC peering from my AWS VPC to my heroku private space, and configured the routing from the VPC for the heroku private space CIDR. However I'm now a bit stuck trying to connect to the private space postgres database.

I think what I need, is to find the private IP address for the heroku postgres database.

Does anyone know how this is done? The only address I can find is the public IP address, which won't work because it would be routed over the internet, rather than the peering connection.



Solution 1:[1]

The peering documentation states:

You cannot connect directly to data services such as Postgres, Kafka or Redis in the private space from the peered VPC.

So it is not possible to do what you are trying to do. You can instead try using a PrivateLink to connect to a Heroku postgres instance from your AWS VPC. More details here: https://devcenter.heroku.com/articles/heroku-postgres-via-privatelink

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 amit_saxena