Class OriginRequestPolicy

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.cloudfront.OriginRequestPolicy
All Implemented Interfaces:
IResource, IOriginRequestPolicy, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:27.667Z") @Stability(Stable) public class OriginRequestPolicy extends Resource implements IOriginRequestPolicy
A Origin Request Policy configuration.

Example:

 // Using an existing origin request policy for a Distribution
 S3Origin bucketOrigin;
 Distribution.Builder.create(this, "myDistManagedPolicy")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(bucketOrigin)
                 .originRequestPolicy(OriginRequestPolicy.CORS_S3_ORIGIN)
                 .build())
         .build();
 
  • Field Details

    • ALL_VIEWER

      @Stability(Stable) public static final IOriginRequestPolicy ALL_VIEWER
      This policy includes all values (query strings, headers, and cookies) in the viewer request.
    • ALL_VIEWER_AND_CLOUDFRONT_2022

      @Stability(Stable) public static final IOriginRequestPolicy ALL_VIEWER_AND_CLOUDFRONT_2022
      This policy includes all values (headers, cookies, and query strings) in the viewer request, and all CloudFront headers that were released through June 2022 (CloudFront headers released after June 2022 are not included).
    • ALL_VIEWER_EXCEPT_HOST_HEADER

      @Stability(Stable) public static final IOriginRequestPolicy ALL_VIEWER_EXCEPT_HOST_HEADER
      This policy includes all values (query strings, and cookies) except the header in the viewer request.
    • CORS_CUSTOM_ORIGIN

      @Stability(Stable) public static final IOriginRequestPolicy CORS_CUSTOM_ORIGIN
      This policy includes the header that enables cross-origin resource sharing (CORS) requests when the origin is a custom origin.
    • CORS_S3_ORIGIN

      @Stability(Stable) public static final IOriginRequestPolicy CORS_S3_ORIGIN
      This policy includes the headers that enable cross-origin resource sharing (CORS) requests when the origin is an Amazon S3 bucket.
    • ELEMENTAL_MEDIA_TAILOR

      @Stability(Stable) public static final IOriginRequestPolicy ELEMENTAL_MEDIA_TAILOR
      This policy is designed for use with an origin that is an AWS Elemental MediaTailor endpoint.
    • USER_AGENT_REFERER_HEADERS

      @Stability(Stable) public static final IOriginRequestPolicy USER_AGENT_REFERER_HEADERS
      This policy includes only the User-Agent and Referer headers.

      It doesn’t include any query strings or cookies.

  • Constructor Details

    • OriginRequestPolicy

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

      protected OriginRequestPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • OriginRequestPolicy

      @Stability(Stable) public OriginRequestPolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable OriginRequestPolicyProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • OriginRequestPolicy

      @Stability(Stable) public OriginRequestPolicy(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • fromOriginRequestPolicyId

      @Stability(Stable) @NotNull public static IOriginRequestPolicy fromOriginRequestPolicyId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String originRequestPolicyId)
      Imports a Origin Request Policy from its id.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      originRequestPolicyId - This parameter is required.
    • getOriginRequestPolicyId

      @Stability(Stable) @NotNull public String getOriginRequestPolicyId()
      The ID of the origin request policy.
      Specified by:
      getOriginRequestPolicyId in interface IOriginRequestPolicy