Overview
You can restrict who can access your distribution based on the country they access it from.
| Type | Meaning |
|---|---|
| Allowlist | List of approved countries; all others are blocked |
| Blocklist | List of banned countries |
The country is determined using a third-party Geo-IP database, which matches the user's IP to its country.
Use Case
Copyright laws to control access to content.
Allowlist vs blocklist
Hands-On Walkthrough
- Open the distribution and go to the Security tab.
- Find CloudFront geographic restrictions (a bit hidden), under Countries, and click Edit.
- Choose Allow list or Block list.
- Example: allowlist with India and United States. All other countries are blocked by CloudFront.
- Save changes. The type now shows allowlist and the countries are listed.
Questions & Answers
Q1: How do you block users from certain countries on CloudFront?
Answer:
Use Geo Restriction with a blocklist of banned countries, or an allowlist of approved ones.
Q2: How does CloudFront know a user's country?
Answer:
A third-party Geo-IP database maps the user's IP to a country.
Check yourself
Quiz
Flashcards
Click the card (or focus it), then use ← → to move and Space to flip.