How to get the IP address of RDS instance in AWS
The IP address of your AWS instance will be the IP address of the RDS instance.
If your hostname of your AWS instance is blah.blah.amazonaws.com
then you can use the dig
command (on Linux machines) or ping
command on both Windows and Linux to find out the IP address of the host:
ping blah.blah.amazonaws.com
This will give you back the IP address of the host (something like this):
c:\ping www.google.com
Pinging www.google.com [216.58.210.100] with 32 bytes of data:
Reply from 216.58.210.100: bytes=32 time=14ms TTL=58
Reply from 216.58.210.100: bytes=32 time=15ms TTL=58
Reply from 216.58.210.100: bytes=32 time=14ms TTL=58
So the IP address of www.google.com is 216.58.210.100. dig
will give you more output but the IP address is also in there. But sometimes the actual IP address of your AWS instance is actually in the hostname itself. For example:
ip-12-34-56-78.us-west-2.compute.internal
The IP address 12.34.56.78
is already in the name (depending on your instance). You can find the hostname in the AWS Console/Dashboard.
It won't display the ip address on the configuration page for the RDS instance because RDS IP's are dynamic in nature. You can dig
for them if you need them but you would be better server using the DNS endpoint for the instance. This remains static and can be found on the details tab of the RDS instance within AWS.