Class ViewerProtocolPolicy
How HTTPs should be handled with your distribution.
Inheritance
System.Object
ViewerProtocolPolicy
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class ViewerProtocolPolicy : Enum
Syntax (vb)
Public NotInheritable Class ViewerProtocolPolicy
Inherits
Enum
Remarks
ExampleMetadata: infused
Examples
// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
Bucket myBucket;
var myWebDistribution = new Distribution(this, "myDist", new DistributionProps {
DefaultBehavior = new BehaviorOptions {
Origin = new S3Origin(myBucket),
AllowedMethods = AllowedMethods.ALLOW_ALL,
ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS
}
});
Synopsis
Fields
ALLOW_ALL | Both HTTP and HTTPS supported. |
HTTPS_ONLY | HTTPS only. |
REDIRECT_TO_HTTPS | Will redirect HTTP requests to HTTPS. |
value__ |
Fields
ALLOW_ALL
Both HTTP and HTTPS supported.
public const ViewerProtocolPolicy ALLOW_ALL
Field Value
Type | Description |
---|---|
ViewerProtocolPolicy |
HTTPS_ONLY
HTTPS only.
public const ViewerProtocolPolicy HTTPS_ONLY
Field Value
Type | Description |
---|---|
ViewerProtocolPolicy |
REDIRECT_TO_HTTPS
Will redirect HTTP requests to HTTPS.
public const ViewerProtocolPolicy REDIRECT_TO_HTTPS
Field Value
Type | Description |
---|---|
ViewerProtocolPolicy |
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |