Class OriginRequestCookieBehavior
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.OriginRequestCookieBehavior
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-06T23:25:05.574Z")
@Stability(Stable)
public class OriginRequestCookieBehavior
extends software.amazon.jsii.JsiiObject
Determines whether any cookies in viewer requests (and if so, which cookies) are included in requests that CloudFront sends to the origin.
Example:
// Creating a custom origin request policy for a Distribution -- all parameters optional S3Origin bucketOrigin; OriginRequestPolicy myOriginRequestPolicy = OriginRequestPolicy.Builder.create(this, "OriginRequestPolicy") .originRequestPolicyName("MyPolicy") .comment("A default policy") .cookieBehavior(OriginRequestCookieBehavior.none()) .headerBehavior(OriginRequestHeaderBehavior.all("CloudFront-Is-Android-Viewer")) .queryStringBehavior(OriginRequestQueryStringBehavior.allowList("username")) .build(); Distribution.Builder.create(this, "myDistCustomPolicy") .defaultBehavior(BehaviorOptions.builder() .origin(bucketOrigin) .originRequestPolicy(myOriginRequestPolicy) .build()) .build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
OriginRequestCookieBehavior
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
OriginRequestCookieBehavior
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic OriginRequestCookieBehavior
all()
All cookies in viewer requests are included in requests that CloudFront sends to the origin.static OriginRequestCookieBehavior
Only the providedcookies
are included in requests that CloudFront sends to the origin.static OriginRequestCookieBehavior
All cookies except the providedcookies
are included in requests that CloudFront sends to the origin.The behavior of cookies: allow all, none or an allow list.The cookies to allow, if the behavior is an allow list.static OriginRequestCookieBehavior
none()
Cookies in viewer requests are not included in requests that CloudFront sends to the origin.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
OriginRequestCookieBehavior
protected OriginRequestCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef) -
OriginRequestCookieBehavior
protected OriginRequestCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
all
All cookies in viewer requests are included in requests that CloudFront sends to the origin. -
allowList
@Stability(Stable) @NotNull public static OriginRequestCookieBehavior allowList(@NotNull @NotNull String... cookies) Only the providedcookies
are included in requests that CloudFront sends to the origin.- Parameters:
cookies
- This parameter is required.
-
denyList
@Stability(Stable) @NotNull public static OriginRequestCookieBehavior denyList(@NotNull @NotNull String... cookies) All cookies except the providedcookies
are included in requests that CloudFront sends to the origin.- Parameters:
cookies
- This parameter is required.
-
none
Cookies in viewer requests are not included in requests that CloudFront sends to the origin.Any cookies that are listed in a CachePolicy are still included in origin requests.
-
getBehavior
The behavior of cookies: allow all, none or an allow list. -
getCookies
The cookies to allow, if the behavior is an allow list.
-