We have a Amazon RDS database in a different VPC and our EC2 servers in a different VPC but in the same region i.e. us-east-1
.
Our servers connect to the RDS via it's publicly accessible endpoint. We are working on reducing our aws bills and we can see high data transfer cost.
Does connecting to RDS instance from an ec2 instance from a different VPC affect the data transfer cost as compared to connecting from the same VPC?
I couldn't find the answer from google or aws forums. Any information will be much appreciated.
AWS bandwidth is fairly expensive, and they charge whenever traffic leaves an available zone. The best way to have zero bandwidth bill is to have them in the same VPC and in the same availability zone. I suspect VPC peering will reduce the price compared with public endpoints, but I haven't checked that - someone will likely comment to let me know, and I'll edit this answer later.
The AWS Open Guide has a good diagram of AWS network pricing. Unfortunately I can't include the image here, I suspect it has hotlink protection enabled, so you will have to visit the site to view it.
Another approach is to use VPC sharing. You can read the blog post here, and the documentation here. Basically you can have a shared VPC across multiple accounts which can reduce or eliminate traffic costs.