Class OriginRequestPolicy

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.737Z") @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.
    • 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