Class OriginRequestPolicy
A Origin Request Policy configuration.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.AWS.CloudFront.dll
Syntax (csharp)
public class OriginRequestPolicy : Resource, IResource, IConstruct, IDependable, IOriginRequestPolicy
Syntax (vb)
Public Class OriginRequestPolicy
Inherits Resource
Implements IResource, IConstruct, IDependable, 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. |
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
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