Class OriginRequestHeaderBehavior

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.735Z") @Stability(Stable) public class OriginRequestHeaderBehavior extends software.amazon.jsii.JsiiObject
Determines whether any HTTP headers (and if so, which headers) 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
    OriginRequestHeaderBehavior(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    OriginRequestHeaderBehavior(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    all(@NotNull String... cloudfrontHeaders)
    All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.
    allowList(@NotNull String... headers)
    Listed headers are included in requests that CloudFront sends to the origin.
    The behavior of headers: allow all, none or an allow list.
    The headers for the allow list or the included CloudFront headers, if applicable.
    HTTP headers 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

    • OriginRequestHeaderBehavior

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

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

    • all

      @Stability(Stable) @NotNull public static OriginRequestHeaderBehavior all(@NotNull @NotNull String... cloudfrontHeaders)
      All HTTP headers in viewer requests are included in requests that CloudFront sends to the origin.

      Additionally, any additional CloudFront headers provided are included; the additional headers are added by CloudFront.

      Parameters:
      cloudfrontHeaders - This parameter is required.
      See Also:
    • allowList

      @Stability(Stable) @NotNull public static OriginRequestHeaderBehavior allowList(@NotNull @NotNull String... headers)
      Listed headers are included in requests that CloudFront sends to the origin.

      Parameters:
      headers - This parameter is required.
    • none

      @Stability(Stable) @NotNull public static OriginRequestHeaderBehavior none()
      HTTP headers are not included in requests that CloudFront sends to the origin.

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

    • getBehavior

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

      @Stability(Stable) @Nullable public List<String> getHeaders()
      The headers for the allow list or the included CloudFront headers, if applicable.