DEV Community

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

Collapse
 
davisengeler profile image
davis

Found this in the ECR pricing documentation:

Data transferred between Amazon Elastic Container Registry and Amazon EC2 within a single region is free of charge (i.e., $0.00 per GB).

I guess since EC2 is underlying Fargate and I'm using the same region, it's free in this case.

Question: What was the need for your NAT Gateway in your configuration? I don't have one and ECR <–> Fargate seem to be communicating fine.

Collapse
 
raphael_jambalos profile image
Raphael Jambalos

Do you have VPC endpoints set up for your network? That's probably why your fargate instances can fetch ECR repositories without much charges.

If you don't have NAT gateway set up (and no VPC endpoint), you're probably using your Fargate containers in your public subnet where its using the Internet Gateway to fetch images from ECR. I'm not sure if Internet Gateways have a per-GB charge, I think it doesnt. If this is the case, you probably don't have to worry about this problem

Thread Thread
 
davisengeler profile image
davis • Edited

Thanks for the insights!