I have setup a RDS instance and I am trying to see if i am able to connect from my EC2 instances(setup using EKS) to the RDS instances.
All my EC2 and RDS instances are in the same VPC.
There is a security group associated with my RDS to which I have set the following inbound and outbound rules.
Inbound: PostgreSQL 5432 192.168.0.0/32
Outbound: All TCP 0-65535 192.168.0.0/32
I am trying to check if I am able to connect from my ec2 instances to the RDS
when i execute
kubectl exec -it debug -- telnet xyz.us-east-1.rds.amazonaws.com 5432
the output is Connected to xyz.us-east-1.rds.amazonaws.com
but when I execute
kubectl exec -it debug -- nslookup xyz.us-east-1.rds.amazonaws.com:5432
the output is can't find xyz.us-east-1.rds.amazonaws.com
Why does nslookup not work and telnet work?
Is telnet a correct way to verify that my EC2 instances will be able to talk to my RDS instances?
Any help on clarifying this would be really great. Thanks.