Class: AWSCDK::CloudFront::GeoRestriction
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::CloudFront::GeoRestriction
- Defined in:
- cloud_front/geo_restriction.rb
Overview
Controls the countries in which content is distributed.
Class Method Summary collapse
-
.allowlist(*locations) ⇒ AWSCDK::CloudFront::GeoRestriction
Allow specific countries which you want CloudFront to distribute your content.
-
.denylist(*locations) ⇒ AWSCDK::CloudFront::GeoRestriction
Deny specific countries which you don't want CloudFront to distribute your content.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#initialize(*args) ⇒ GeoRestriction
constructor
A new instance of GeoRestriction.
-
#locations ⇒ Array<String>
Two-letter, uppercase country code for a country that you want to allow/deny.
-
#restriction_type ⇒ String
Specifies the restriction type to impose.
Constructor Details
#initialize(*args) ⇒ GeoRestriction
Returns a new instance of GeoRestriction.
8 9 10 |
# File 'cloud_front/geo_restriction.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_cloudfront.GeoRestriction does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.allowlist(*locations) ⇒ AWSCDK::CloudFront::GeoRestriction
Allow specific countries which you want CloudFront to distribute your content.
23 24 25 26 27 28 |
# File 'cloud_front/geo_restriction.rb', line 23 def self.allowlist(*locations) locations.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "locations[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.GeoRestriction", "allowlist", [*locations]) end |
.denylist(*locations) ⇒ AWSCDK::CloudFront::GeoRestriction
Deny specific countries which you don't want CloudFront to distribute your content.
34 35 36 37 38 39 |
# File 'cloud_front/geo_restriction.rb', line 34 def self.denylist(*locations) locations.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "locations[#{index}]") end Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_cloudfront.GeoRestriction", "denylist", [*locations]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 17 |
# File 'cloud_front/geo_restriction.rb', line 12 def self.jsii_overridable_methods { :locations => { kind: :property, name: "locations", is_optional: false }, :restriction_type => { kind: :property, name: "restrictionType", is_optional: false }, } end |
Instance Method Details
#locations ⇒ Array<String>
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
47 48 49 |
# File 'cloud_front/geo_restriction.rb', line 47 def locations() jsii_get_property("locations") end |
#restriction_type ⇒ String
Specifies the restriction type to impose.
54 55 56 |
# File 'cloud_front/geo_restriction.rb', line 54 def restriction_type() jsii_get_property("restrictionType") end |