Class OriginRequestPolicy
A Origin Request Policy configuration.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class OriginRequestPolicy : Resource, IResource, IOriginRequestPolicy
Syntax (vb)
Public Class OriginRequestPolicy
Inherits Resource
Implements IResource, IOriginRequestPolicy
Remarks
Resource: AWS::CloudFront::OriginRequestPolicy
ExampleMetadata: infused
Examples
// Using an existing origin request policy for a Distribution
S3Origin bucketOrigin;
new Distribution(this, "myDistManagedPolicy", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = bucketOrigin,
OriginRequestPolicy = OriginRequestPolicy.CORS_S3_ORIGIN
}
});
Synopsis
Constructors
OriginRequestPolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
OriginRequestPolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
OriginRequestPolicy(Construct, String, IOriginRequestPolicyProps) |
Properties
ALL_VIEWER | This policy includes all values (query strings, headers, and cookies) in the viewer request. |
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 | This policy includes all values (query strings, and cookies) except the header in the viewer request. |
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 | This policy includes the headers that enable cross-origin resource sharing (CORS) requests when the origin is an Amazon S3 bucket. |
ELEMENTAL_MEDIA_TAILOR | This policy is designed for use with an origin that is an AWS Elemental MediaTailor endpoint. |
OriginRequestPolicyId | The ID of the origin request policy. |
USER_AGENT_REFERER_HEADERS | This policy includes only the User-Agent and Referer headers. |
Methods
FromOriginRequestPolicyId(Construct, String, String) | Imports a Origin Request Policy from its id. |
Constructors
OriginRequestPolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected OriginRequestPolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
OriginRequestPolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected OriginRequestPolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
OriginRequestPolicy(Construct, String, IOriginRequestPolicyProps)
public OriginRequestPolicy(Construct scope, string id, IOriginRequestPolicyProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IOriginRequestPolicyProps
Properties
ALL_VIEWER
This policy includes all values (query strings, headers, and cookies) in the viewer request.
public static IOriginRequestPolicy ALL_VIEWER { get; }
Property Value
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).
public static IOriginRequestPolicy ALL_VIEWER_AND_CLOUDFRONT_2022 { get; }
Property Value
ALL_VIEWER_EXCEPT_HOST_HEADER
This policy includes all values (query strings, and cookies) except the header in the viewer request.
public static IOriginRequestPolicy ALL_VIEWER_EXCEPT_HOST_HEADER { get; }
Property Value
CORS_CUSTOM_ORIGIN
This policy includes the header that enables cross-origin resource sharing (CORS) requests when the origin is a custom origin.
public static IOriginRequestPolicy CORS_CUSTOM_ORIGIN { get; }
Property Value
CORS_S3_ORIGIN
This policy includes the headers that enable cross-origin resource sharing (CORS) requests when the origin is an Amazon S3 bucket.
public static IOriginRequestPolicy CORS_S3_ORIGIN { get; }
Property Value
ELEMENTAL_MEDIA_TAILOR
This policy is designed for use with an origin that is an AWS Elemental MediaTailor endpoint.
public static IOriginRequestPolicy ELEMENTAL_MEDIA_TAILOR { get; }
Property Value
OriginRequestPolicyId
The ID of the origin request policy.
public virtual string OriginRequestPolicyId { get; }
Property Value
System.String
USER_AGENT_REFERER_HEADERS
This policy includes only the User-Agent and Referer headers.
public static IOriginRequestPolicy USER_AGENT_REFERER_HEADERS { get; }
Property Value
Remarks
It doesn’t include any query strings or cookies.
Methods
FromOriginRequestPolicyId(Construct, String, String)
Imports a Origin Request Policy from its id.
public static IOriginRequestPolicy FromOriginRequestPolicyId(Construct scope, string id, string originRequestPolicyId)
Parameters
- scope Constructs.Construct
- id System.String
- originRequestPolicyId System.String
Returns