@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-07T23:47:02.144Z") @Stability(value=Experimental) 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(String... locations)
(experimental) Allow specific countries which you want CloudFront to distribute your content.
|
static GeoRestriction |
blacklist(String... locations)
Deprecated.
use `denylist`
|
static GeoRestriction |
denylist(String... locations)
(experimental) Deny specific countries which you don't want CloudFront to distribute your content.
|
List<String> |
getLocations()
(experimental) Two-letter, uppercase country code for a country that you want to allow/deny.
|
String |
getRestrictionType()
(experimental) Specifies the restriction type to impose.
|
static GeoRestriction |
whitelist(String... locations)
Deprecated.
use `allowlist`
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected GeoRestriction(software.amazon.jsii.JsiiObjectRef objRef)
protected GeoRestriction(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) @NotNull public static GeoRestriction allowlist(@NotNull String... locations)
locations - Two-letter, uppercase country code for a country that you want to allow. This parameter is required.@Stability(value=Deprecated) @Deprecated @NotNull public static GeoRestriction blacklist(@NotNull String... locations)
locations - This parameter is required.@Stability(value=Experimental) @NotNull public static GeoRestriction denylist(@NotNull String... locations)
locations - Two-letter, uppercase country code for a country that you want to deny. This parameter is required.@Stability(value=Deprecated) @Deprecated @NotNull public static GeoRestriction whitelist(@NotNull String... locations)
locations - This parameter is required.@Stability(value=Experimental) @NotNull public List<String> getLocations()
Include one element for each country. See ISO 3166-1-alpha-2 code on the International Organization for Standardization website
@Stability(value=Experimental) @NotNull public String getRestrictionType()
Copyright © 2022. All rights reserved.