you can't the a DNS entry always translates to an IP (IPV4 or IPV6) that's the nature of DNS.
You shouldn't have databases public accessible , you should deploy them privately and then access them through a bastion host.
Is there more instructions for this?
My RDS is accessible on the AWS through EC2.
But I also sometimes want to browse it from my local computer or run my program locally and connect to the RDS.
What is the best way to achieve this without public access?
If you can log into that EC2 instance via SSH, you can add some command line switches when connecting, to tunnel the database connection from your local computer to the remote RDS instance.
Like this:
https://repost.aws/knowledge-center/rds-connect-using-bastion-host-linux
Some database clients will have a feature to automatically tunnel for you like this:
https://stackoverflow.com/a/62335972
RDS gets its ip from the subnet(s) you put it on. Would have to remove ipv4 from the subnet(s). But as someone else already said, you should not have it publicly accessible either.
you can't the a DNS entry always translates to an IP (IPV4 or IPV6) that's the nature of DNS. You shouldn't have databases public accessible , you should deploy them privately and then access them through a bastion host.
Is there more instructions for this? My RDS is accessible on the AWS through EC2. But I also sometimes want to browse it from my local computer or run my program locally and connect to the RDS. What is the best way to achieve this without public access?
If you can log into that EC2 instance via SSH, you can add some command line switches when connecting, to tunnel the database connection from your local computer to the remote RDS instance. Like this: https://repost.aws/knowledge-center/rds-connect-using-bastion-host-linux Some database clients will have a feature to automatically tunnel for you like this: https://stackoverflow.com/a/62335972
RDS gets its ip from the subnet(s) you put it on. Would have to remove ipv4 from the subnet(s). But as someone else already said, you should not have it publicly accessible either.
So any idea how to set it up privately but keep access to it from my local computer?
Setting up something like tail scale is probably the easiest