1

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.

1 Answer 1

1

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.

2
  • Thanks for the answer Tim. We are planning to move our DB instance in the same VPC as our ec2 instances anyway so I don't think we will do VPC peering. VPC sharing isn't required as we aren't sharing the same VPC across multiple accounts. Can you have a look at this Data Transfer cost and explain this to me a little as to where it can be coming from? i.imgur.com/6Xz7dCL.png We use services like ec2, RDS, elasticcache, S3
    – Axel
    Dec 2, 2019 at 7:34
  • Looks like quite a bit of data between AZs, and more going out to the internet. Moving your resources into the same VPC / AZ is the best option. Beware of traffic between AZs, which is strongly recommended for reliability, but if you're not careful can easily increase your bandwidth costs.
    – Tim
    Dec 2, 2019 at 8:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .