Connect to RDS Private Instance from Docker Container I am running a docker swarm cluster and I was trying to connect to a private RDS instance within the same VPC from a docker container which is running in an EC2 within the same VPC but I get an error like "unknown host". I have enabled the database port number(3306) in RDS security group for my EC2 instances.

However, I am able to connect to the database from the host level but not from the container level.
As per the error, it looks like the resolution is not happening for host xxxxx-xxxxx-xxxx.xxxxxxxxx.us-east-2.rds.amazonaws.com'. I mean the hostname is not getting resolved to the IP address from inside the container. 

You may need to check if the DNS resolver is working properly from inside the container or not. For testing, you can try to use the IP instead of the RDS endpoint hostname and see if it works.