@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)",
date="2023-01-31T18:36:57.081Z")
public class GeoRestriction
extends software.amazon.jsii.JsiiObject
Example:
// Adding restrictions to a Cloudfront Web Distribution. Bucket sourceBucket; CloudFrontWebDistribution.Builder.create(this, "MyDistribution") .originConfigs(List.of(SourceConfiguration.builder() .s3OriginSource(S3OriginConfig.builder() .s3BucketSource(sourceBucket) .build()) .behaviors(List.of(Behavior.builder().isDefaultBehavior(true).build())) .build())) .geoRestriction(GeoRestriction.allowlist("US", "GB")) .build();
Modifier | Constructor and Description |
---|---|
protected |
GeoRestriction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
GeoRestriction(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static GeoRestriction |
allowlist(java.lang.String... locations)
Allow specific countries which you want CloudFront to distribute your content.
|
static GeoRestriction |
blacklist(java.lang.String... locations)
Deprecated.
use `denylist`
|
static GeoRestriction |
denylist(java.lang.String... locations)
Deny specific countries which you don't want CloudFront to distribute your content.
|
java.util.List<java.lang.String> |
getLocations()
Two-letter, uppercase country code for a country that you want to allow/deny.
|
java.lang.String |
getRestrictionType()
Specifies the restriction type to impose.
|
static GeoRestriction |
whitelist(java.lang.String... locations)
Deprecated.
use `allowlist`
|
protected GeoRestriction(software.amazon.jsii.JsiiObjectRef objRef)
protected GeoRestriction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static GeoRestriction allowlist(java.lang.String... locations)
locations
- Two-letter, uppercase country code for a country that you want to allow. This parameter is required.@Deprecated public static GeoRestriction blacklist(java.lang.String... locations)
locations
- This parameter is required.public static GeoRestriction denylist(java.lang.String... locations)
locations
- Two-letter, uppercase country code for a country that you want to deny. This parameter is required.@Deprecated public static GeoRestriction whitelist(java.lang.String... locations)
locations
- This parameter is required.public java.util.List<java.lang.String> getLocations()
Include one element for each country. See ISO 3166-1-alpha-2 code on the International Organization for Standardization website
public java.lang.String getRestrictionType()