0

I am trying to put my RDS instance behind an elastic loadbalancer. Unfortunately, I am not able to find the RDS in listed instance while creating a target group. I am wondering how to do that, is this possible?

Prometheus
  • 549
  • 1
  • 7
  • 18
  • Which RDS? For Aurora load balancing is already build in. For others, I'm not aware of such possibility. And why would you to have it? It would only be useful for read replicas anyway. – Marcin Mar 17 '20 at 11:32
  • My RDS is in private subnet, I want to access it from the internet. The current workaround is: I have created a jump host in the same VPC but in public subnet. I tunnel to this jump host and connect to the RDS. Please let me know if there is a better solution to this. – Prometheus Mar 17 '20 at 11:44
  • I'm not aware of any out of the box solution to this. Having RDS in private subnet, but exposing it to outside defeats its initial purpose of being in private subnet. I think what you have now is good enough for testing and development. – Marcin Mar 17 '20 at 11:52
  • 1
    Using a Jump Host is the correct (and secure!) method. – John Rotenstein Mar 18 '20 at 04:18
  • The only problem Jump Host approach is managing ssh keys. – Prometheus Mar 19 '20 at 02:48

2 Answers2

2

There is a work-around I have done. While creating the target group I have selected IP address instead of the instance id. The IP address is not directly provided by AWS. I ran nslookup command with the domain name of RDS as input to get the IP address. I was successfully able to configure ELB with this approach.

Note: This is not the recommended way, as the IP address of RDS may change, according to the AWS document.

Prometheus
  • 549
  • 1
  • 7
  • 18
  • Just to add to this, one of the situations where IP of RDS instances change is if you change the size of the instance for example. I vertically scaled my instance and that made the TG stop working. – Murilo Feb 20 '23 at 04:42
0

I know this is the Old question but still this problem is there.

My solution for this is to create a simple lambda function to check the IP address of the RDS instance and if this is changed attached it to the target group. In this case, we have to keep the IP address of the RDS otherwise we can not compare the previous and current IP address. that means this lambda function should be state full. we can achieve this by storing these details in the S3 bucket or Dynamodb.

Supun Kavinda
  • 308
  • 1
  • 6
  • 20