In part 1 of this blog post series I focused on breaking down the Data transfer cost across from three most common outbound channels which are:
- Directly from Internet Gateway (IGW)
- from private subnet to NATA gateway, same Availability Zone.
- and private subnet to NAT gateway where they subnets are in two different AZs.
In this post I would like to talk about another common Data transfer cost which is between the workload that you deployed in your VPC and public aws services such as S3, Dynamo, Kinesis, and etc.. and provide you with some tips on how we can optimize for cost efficiency in this use-case.
The two primarily most common scenario in this use-case are:
- workload is running on a public subnet communicating with AWS public endpoint of aws services. (example: S3)
2. workload is running on a private subnet communicating with AWS services. (example: S3)
For use-case 1 there is no additional data transfer cost, but for 2nd use-case customer has to pay for each GB of data that processes over NAT Gateway.

Tips for lower cost, and potentially improving latency
S3 and Dynamo DB supports VPC Gateway endpoint that uses AWS Backbone networking infrastructure to connect your VPC workload (no matter its on public or private subnet) to the private endpoint of these two services thus your request no longer requires to be processes using NAT gateway and travel to internet before it arrives at S3 or Dynamo endpoint. This results in reducing the data transfer cost by 100% while it can enhance the latency since it no longer go via internet, although I have never measure how much of latency difference it makes, if any.
I am not sure why AWS doesn’t want to enable VPC Gateway endpoint as the default way of connecting to S3 and Dynamo but its surprising how many teams aren’t leveraging this simple yet useful feature.
For services other than S3 and Dynamo that run outside of customer networking perimeter, such as SNS, SQS, and Kinesis, you would have to use something else called interface endpoint that is a bit more work to set and is not free of charge and I don’t intend to discuss it in this blog post. (I have actually never used it 🙂 )