Create the Endpoint Service
Here is a link to AWS Private Link Docs on creating an Endpoint Service- Create Network Load Balancer (NLB) within your VPC and configure it for each subnet/availability zone if it does not exist already
- Create a VPC endpoint service and choose your Network Load Balancer (NLB)
- Safelist Streamkap’s AWS VPC Account ID and ARN (arn:aws:iam::300973880807:root). This will allow inbound access from our AWS PrivateLink. Here is teh VPC mapping to use for your region.
AWS Region | VPC |
---|---|
us-west-2 | vpc-0b96d65e5bb090974 |
us-east-1 | vpc-00b9ec8b5308e675a |
ap-southeast-2 | vpc-0cc5853e497801cc5 |
eu-west-1 | vpc-0a28eb61f7edfcaa0 |
- Send the service name generated here to Streamkap so that we setup our AWS PrivateLink to talk to yours.
- Update Acceptance Settings to your preference. If you disable it, Streamkap will be able to connect automatically without permission. You have already safelisted our account in earlier steps
- Send the service name to Streamkap to generate the connection
IP & Port Forwarding
Network Load Balancers (NLB) can route traffic to an EC2 instance, an IP address, or a Lambda function through target groups. AWS RDS Aurora databases give you an endpoint to access your database. This endpoint resolves to an IP address but unfortunately, this internal IP is subject to change. There are a couple of options available to work with this.Port Forwarder
You must deploy an EC2 instance that is configured to do port forwarding (accepting requests from the NLB and forwarding those requests to the RDS database). Here is a sample script that you can use to set up the EC2 port forwarding instance:All Except Amazon Linux 2023
Bash
Amazon Linux 2023
Bash
Lambda Function
It’s possible to deploy a lambda function check the current IP address and update the NLB target group accordingly. To use the RDS IP address in your NLB target group, do the following:- Run nslookup with the domain name of RDS endpoint as the input to find the IP address:
nslookup DNS_ENDPOINT
- Configure your NLB target group with the IP address from above
- Deploy a lambda function to periodically perform nslookup on the RDS endpoint to see if the IP address has changed and update the target group with the new IP address.