Geographic restrictions with Amazon CloudFront
CloudFront has added a geo-restriction feature to make it easier to restrict access to your content based on the geographic location of your viewers.
How to do it...
- Log in to the
AWS Console
, selectCloudFront Distributions
, then select your distribution, and go to theRestrictions
tab.

CloudFront Console
- Click on
Edit
.

CloudFront Restrictions Setup
Note
Once you enable the feature, you can select whether you want to configure a whitelist or blacklist of countries for your distribution.
- Select one or more countries from the list in the left-side box, and move those countries to the right-side box and then click on
Yes, Edit
button.

Enable CloudFront Restrictions
- That's it! Once this configuration gets deployed to our worldwide edge locations (which takes a few minutes), the CloudFront edge locations will begin blocking users from certain countries based on your configuration.
Note
For users that are blocked, CloudFront will serve an HTTP response of 403...