Reputation: 11336
I'm using CloudFront on top of a S3 bucket mostly to help me reduce the cost my hosting bill.
10000 HTTP Requests on S3 cost $0.01 on US Standard Region and same requests cost 0.0075 on CloudFront's US region.
I see that CloudFront automatically uses the closest region to the end user and therefor I see in some cases heavy use of some expensive regions such South America, Asia, Australia, etc. It makes sense since the idea of CloudFront is to decrease loading time.
The point is that I originally expected to reduce the cost to a level that I'm not nearly near at and - probably by just looking at my numbers - I'll probably end up paying even more than before.
My question is. Is there any way I can limit CloudFront availability only to US Region so everyone will default to it?
I read their FAQs and couldn't find any info related to it.
Upvotes: 3
Views: 2054
Reputation: 6935
"I see that CloudFront automatically uses the closest region to the end user"
You're mixing up your information here. CloudFront automatically uses the closest edge location to the end user.
S3 buckets only live in a single region. If you tell CloudFront to create a distribution for an S3 bucket in the us-east-1
region, then CloudFront will always pull from that bucket in that region.
CloudFront then copies the data from that region-locked bucket to an edge location that is closer to the end user.
In that way, you only pay for S3 costs for the region the bucket is in, plus whatever the CloudFront costs are.
Make sense?
Upvotes: 6