GeoRestriction

class aws_cdk.aws_cloudfront.GeoRestriction(*args: Any, **kwargs)

Bases: object

Controls the countries in which content is distributed.

Attributes

locations

Two-letter, uppercase country code for a country that you want to allow/deny.

Include one element for each country. See ISO 3166-1-alpha-2 code on the International Organization for Standardization website

Return type

List[str]

restriction_type

Specifies the restriction type to impose.

Return type

str

Static Methods

classmethod allowlist(*locations)

Allow specific countries which you want CloudFront to distribute your content.

Parameters

locations (str) – Two-letter, uppercase country code for a country that you want to allow. Include one element for each country. See ISO 3166-1-alpha-2 code on the International Organization for Standardization website

Return type

GeoRestriction

classmethod blacklist(*locations)

(deprecated) DEPRECATED.

Parameters

locations (str) –

Deprecated

use denylist

Stability

deprecated

Return type

GeoRestriction

classmethod denylist(*locations)

Deny specific countries which you don’t want CloudFront to distribute your content.

Parameters

locations (str) – Two-letter, uppercase country code for a country that you want to deny. Include one element for each country. See ISO 3166-1-alpha-2 code on the International Organization for Standardization website

Return type

GeoRestriction

classmethod whitelist(*locations)

(deprecated) DEPRECATED.

Parameters

locations (str) –

Deprecated

use allowlist

Stability

deprecated

Return type

GeoRestriction