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.119.0 (build 1634eac)",
date="2025-11-17T14:40:47.117Z")
@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
ConstructorsModifierConstructorDescriptionprotectedOriginRequestCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedOriginRequestCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic OriginRequestCookieBehaviorall()All cookies in viewer requests are included in requests that CloudFront sends to the origin.static OriginRequestCookieBehaviorOnly the providedcookiesare included in requests that CloudFront sends to the origin.static OriginRequestCookieBehaviorAll cookies except the providedcookiesare 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 OriginRequestCookieBehaviornone()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, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 String... cookies) Only the providedcookiesare included in requests that CloudFront sends to the origin.- Parameters:
cookies- This parameter is required.
-
denyList
@Stability(Stable) @NotNull public static OriginRequestCookieBehavior denyList(@NotNull String... cookies) All cookies except the providedcookiesare 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.
-