Class OriginRequestQueryStringBehavior

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.OriginRequestQueryStringBehavior
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-11T23:26:30.065Z") @Stability(Stable) public class OriginRequestQueryStringBehavior extends software.amazon.jsii.JsiiObject
Determines whether any URL query strings in viewer requests (and if so, which query strings) 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
    OriginRequestQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    OriginRequestQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    all()
    All query strings in viewer requests are included in requests that CloudFront sends to the origin.
    allowList(@NotNull String... queryStrings)
    Only the provided queryStrings are included in requests that CloudFront sends to the origin.
    denyList(@NotNull String... queryStrings)
    All query strings except the provided queryStrings are included in requests that CloudFront sends to the origin.
    The behavior of query strings -- allow all, none, or only an allow list.
    The query strings to allow, if the behavior is an allow list.
    Query strings 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

    • OriginRequestQueryStringBehavior

      protected OriginRequestQueryStringBehavior(software.amazon.jsii.JsiiObjectRef objRef)
    • OriginRequestQueryStringBehavior

      protected OriginRequestQueryStringBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • all

      @Stability(Stable) @NotNull public static OriginRequestQueryStringBehavior all()
      All query strings in viewer requests are included in requests that CloudFront sends to the origin.
    • allowList

      @Stability(Stable) @NotNull public static OriginRequestQueryStringBehavior allowList(@NotNull @NotNull String... queryStrings)
      Only the provided queryStrings are included in requests that CloudFront sends to the origin.

      Parameters:
      queryStrings - This parameter is required.
    • denyList

      @Stability(Stable) @NotNull public static OriginRequestQueryStringBehavior denyList(@NotNull @NotNull String... queryStrings)
      All query strings except the provided queryStrings are included in requests that CloudFront sends to the origin.

      Parameters:
      queryStrings - This parameter is required.
    • none

      @Stability(Stable) @NotNull public static OriginRequestQueryStringBehavior none()
      Query strings in viewer requests are not included in requests that CloudFront sends to the origin.

      Any query strings that are listed in a CachePolicy are still included in origin requests.

    • getBehavior

      @Stability(Stable) @NotNull public String getBehavior()
      The behavior of query strings -- allow all, none, or only an allow list.
    • getQueryStrings

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