How to set up your Postgres database using PrivateLink
Follow these instructions to set up PrivateLink for your private Postgres data source.Create a target group for the Network Load Balancer that you will create in the next step. Pick IP addresses on the configuration page and give the target group a name. Choose the VPC that your database is in.
On the next page, specify the IP of the Postgres RDS and include it as pending. You can use the 

dig +short YOUR_RDS_DNS_ENDPOINT command to get the IP of the RDS instance. Note that the IP address can change without notice. To handle this, use this guide to create a Lambda function that periodically checks the IP and updates the target group.
In your VPC, create a Network Load Balancer and configure it for each subnet (AZ) in which the service should be available. Make sure that Internal is selected for the scheme field.
Make sure that the VPC selected is the same as the Postgres database and pick the appropriate AZs. Also, select the target group you created in the step above and update the port to the Postgres port.




Create a VPC endpoint service configuration. Give it an appropriate name and select the NLB created above in the available load balancers list. Choose the other settings as specified in the image below.

Add our AWS Account ID to allow access to your VPC (
arn:aws:iam::231173364718:user/privatelink). Send the service name of your VPC endpoint service to us so that we can set up the connection on our end.
