Skip to content

How to prevent client access from South America to local Edge Locations

0

Hi there.

In our company, we distribute static files hosted on Amazon S3 Buckets through AWS CloudFront, so we are experiencing a large cost increase around Data Transfer Out to South America, where our main clients are located. Data Transfer Cost in South America is bigger than Data Transfer cost in United States regions, so we would like to know if there is a way to force clients to download theses static files hosted on S3 Bucket from AWS CloudFront Edge Locations locate on the United States instead of South America Edge Locations. Latency isn't a big problem for us in this scenario.

We already search about CloudFront geographic restrictions, but it won't work for us, because we don't intend to block user access from South America, only makes these users access files directly from US if it's possible.

Forcing clients to download these files from US, we expect to save more money around this infrastructure.

1 Answer
1
Accepted Answer

Unfortunately, there isn't a direct way to force CloudFront to serve content from a specific region while still allowing access from other regions. CloudFront is designed to automatically route requests to the nearest edge location to minimize latency. HOWEVER, CloudFront offers a feature called "Price Classes" that allows you to exclude more expensive edge locations from your distribution while still serving content to all users globally. SO By configuring your CloudFront distribution to use Price Class 100 (North America and Europe only) [See Doc below], requests from South American users will still be served, but they'll be routed to edge locations in North America rather than using the more expensive South American edge locations.

See this doc : https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_cloudfront/PriceClass.html

How to Implement, of-course after doing your due diligence and testing:

  1. Open the CloudFront console
  2. Select your distribution
  3. Edit the distribution settings
  4. Change the "Price Class" setting from "Use All Edge Locations" to "Use Only North America and Europe"
  5. Save your change
AWS

answered a year ago

AWS
EXPERT

reviewed a year ago

EXPERT

reviewed a year ago

  • Thank you so much, Zouhair!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.