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:
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:
How AWS Shield works