@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.135Z") @Stability(value=Stable) 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)
Allow specific countries which you want CloudFront to distribute your content.
|
static GeoRestriction |
denylist(String... locations)
Deny specific countries which you don't want CloudFront to distribute your content.
|
List<String> |
getLocations()
Two-letter, uppercase country code for a country that you want to allow/deny.
|
String |
getRestrictionType()
Specifies the restriction type to impose.
|
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=Stable) @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=Stable) @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=Stable) @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=Stable) @NotNull public String getRestrictionType()
Copyright © 2022. All rights reserved.