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.96.0 (build 921e240)", date="2024-04-10T22:22:24.822Z") @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

    Constructors
    Modifier
    Constructor
    Description
    protected
    OriginRequestCookieBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    OriginRequestCookieBehavior(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    all()
    All cookies in viewer requests are included in requests that CloudFront sends to the origin.
    allowList(@NotNull String... cookies)
    Only the provided cookies are included in requests that CloudFront sends to the origin.
    denyList(@NotNull String... cookies)
    All cookies except the provided cookies 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.
    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

      @Stability(Stable) @NotNull public static OriginRequestCookieBehavior 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 provided cookies 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 provided cookies are included in requests that CloudFront sends to the origin.

      Parameters:
      cookies - This parameter is required.
    • none

      @Stability(Stable) @NotNull public static OriginRequestCookieBehavior 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

      @Stability(Stable) @NotNull public String getBehavior()
      The behavior of cookies: allow all, none or an allow list.
    • getCookies

      @Stability(Stable) @Nullable public List<String> getCookies()
      The cookies to allow, if the behavior is an allow list.