Class: AWSCDK::CloudFront::CfnDistribution::GeoRestrictionProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::CloudFront::CfnDistribution::GeoRestrictionProperty
- Defined in:
- cloud_front/cfn_distribution.rb
Overview
A complex type that controls the countries in which your content is distributed.
CloudFront determines the location of your users using MaxMind GeoIP databases. To disable geo restriction, remove the Restrictions property from your stack template.
Instance Attribute Summary collapse
-
#locations ⇒ Array<String>?
readonly
A complex type that contains a
Locationelement for each country in which you want CloudFront either to distribute your content (whitelist) or not distribute your content (blacklist). -
#restriction_type ⇒ String
readonly
The method that you want to use to restrict distribution of your content by country:.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(restriction_type:, locations: nil) ⇒ GeoRestrictionProperty
constructor
A new instance of GeoRestrictionProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(restriction_type:, locations: nil) ⇒ GeoRestrictionProperty
Returns a new instance of GeoRestrictionProperty.
2150 2151 2152 2153 2154 2155 |
# File 'cloud_front/cfn_distribution.rb', line 2150 def initialize(restriction_type:, locations: nil) @restriction_type = restriction_type Jsii::Type.check_type(@restriction_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "restrictionType") @locations = locations Jsii::Type.check_type(@locations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "locations") unless @locations.nil? end |
Instance Attribute Details
#locations ⇒ Array<String>? (readonly)
A complex type that contains a Location element for each country in which you want CloudFront either to distribute your content ( whitelist ) or not distribute your content ( blacklist ).
The Location element is a two-letter, uppercase country code for a country that you want to include in your blacklist or whitelist . Include one Location element for each country.
CloudFront and MaxMind both use ISO 3166 country codes. For the current list of countries and the corresponding codes, see ISO 3166-1-alpha-2 code on the International Organization for Standardization website. You can also refer to the country list on the CloudFront console, which includes both country names and codes.
2174 2175 2176 |
# File 'cloud_front/cfn_distribution.rb', line 2174 def locations @locations end |
#restriction_type ⇒ String (readonly)
The method that you want to use to restrict distribution of your content by country:.
none: No geo restriction is enabled, meaning access to content is not restricted by client geo location.blacklist: TheLocationelements specify the countries in which you don't want CloudFront to distribute your content.whitelist: TheLocationelements specify the countries in which you want CloudFront to distribute your content.
2165 2166 2167 |
# File 'cloud_front/cfn_distribution.rb', line 2165 def restriction_type @restriction_type end |
Class Method Details
.jsii_properties ⇒ Object
2176 2177 2178 2179 2180 2181 |
# File 'cloud_front/cfn_distribution.rb', line 2176 def self.jsii_properties { :restriction_type => "restrictionType", :locations => "locations", } end |
Instance Method Details
#to_jsii ⇒ Object
2183 2184 2185 2186 2187 2188 2189 2190 |
# File 'cloud_front/cfn_distribution.rb', line 2183 def to_jsii result = {} result.merge!({ "restrictionType" => @restriction_type, "locations" => @locations, }) result.compact end |