DEV Community

Discussion on: How we lost $800/mo with Amazon ECS Fargate

Collapse
 
hcalsos profile image
Hans Christian Alsos

Interesting report, but in my view this sounds more like a problem with your vpc setup and nat-gateway. Have you considered using vpc endpoints for ecr access?
This would allow you to read/write to ecr without going though your nat-gateway, and by doing so, reduce your cost related to the nat-gateway.

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Ohh, that's a great insight. I think that would be the most appropriate solution to this problem. I'll try that on my setup. Thanks Hans! :D

Collapse
 
alican profile image
Ali

I am looking to add VPC endpoints to avoid crazy NAT gateway bandwidth charges.

My understanding is that 'gateway' type of endpoints are free but 'Interface' costs money. ($0.01 per hour + $0.01 per GB at the time of writing)

S3 endpoints can be a 'gateway' type but ECR endpoints need to be 'interface' type.

so... I am not clear on these two things:

(a) Am I right to assume that, since ECR image storage is actually provided by S3, I would just need to have an S3 type of VPC endpoint to avoid these huge NAT gateway bandwidth charges?

OR

(b) Do I need to have ECR and S3 endpoints together and my cost saving is going to be paying $0.01 per GB instead of $0.045 per GB (nat gateway price)?

Collapse
 
chayanikaa profile image
Chayanika Khatua

Hi! I was inspired to research this based on your question, the effect of the Gateway endpoint alone vs ECR endpoints: dev.to/chayanikaa/cost-optimisatio...