How can I restrict users in certain locations from accessing web content served by my CloudFront distribution?

2 minutos de lectura

I want to restrict users in certain countries from accessing the web content served by my Amazon CloudFront distribution.


Turn on CloudFront geo restriction for your distribution by following these steps:

  1. Open the CloudFront console.
  2. Choose the distribution that you want to apply geo restriction to.
  3. Choose the Geographic Restrictions tab.
  4. Choose Edit.
  5. To allow access to countries, for Restriction type choose Allow List. To block access from certain countries, choose Block List.
  6. For Countries, select the countries that you want to allow or block. Then, choose Add.
  7. Choose Save Changes.

Note: You can set your CloudFront distribution to return a custom error message when a user from a blocked country tries to access content.

Consider these additional ways to restrict access to your content served through CloudFront:

Related information

How AWS Shield works

OFICIAL DE AWSActualizada hace un año