Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS RDS IP static or dynamic?

I have an RDS instance with a URL that was provided by Amazon. (This URL has an IP that's associated with (of course)).

To make connecting to the DB easier I made a redirect from my domain like this: "db.myDomain.com" to the IP of the DB Instance.

For a week it all worked fine, but then, suddenly, it stopped working. After searching for a few hours, I have realized that the IP I was redirecting to was not the same as the IP of the instance.

This made me think that maybe the IPs on RDS are dynamic and the only way to access the DB is with the URL provided by Amazon.

Is this correct? If so, is there away to redirect from one URL to another?

like image 987
Yaki Klein Avatar asked Jan 12 '15 09:01

Yaki Klein


People also ask

Does AWS use static IP?

Short description. An Elastic IP address is a static public IPv4 address associated with your AWS account in a specific Region. Unlike an auto-assigned public IP address, an Elastic IP address is preserved after you stop and start your instance in a virtual private cloud (VPC).

Does AWS RDS have IP address?

Each RDS on Outposts DB instance has a private IP address for traffic inside its virtual private cloud (VPC). This private IP address isn't publicly accessible. You can use the Public option to set whether the DB instance also has a public IP address in addition to the private IP address.

Should RDS be in public or private subnet?

You should provision AWS RDS instances in private subnets to shield them from direct internet traffic. However, suppose you must deploy an RDS instance on public subnets for any reason. In that case, you must verify that no inbound rules exist in any security group that permits unfettered access (i.e., 0.0.

How do I know if my RDS is public or private?

To check whether a DB instance is publicly accessible, you can use the Amazon RDS Console or the AWS CLI. To change the Publicly Accessible property of the Amazon RDS instance to Yes: 1. Verify that your VPC has an internet gateway attached to it.


1 Answers

Yes, your observation about the dynamic nature of the IPs for RDS is correct and it is the anticipated behaviour of the Service. Always use the URL provided for RDS instance to access it RDS instance(s).

For most of the use cases, you don't to do a redirect to access; as the DNS name would go inside a config file / connection string. If you still need a friendly name - you may use the Route53 to create an alias. Here is a documentation link from AWS to accomplish that [ https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-rds-db.html ] - it is easier & convenient.

like image 157
Naveen Vijay Avatar answered Sep 17 '22 09:09

Naveen Vijay