Enum ViewerProtocolPolicy
How HTTPs should be handled with your distribution.
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum ViewerProtocolPolicy
Syntax (vb)
Public Enum ViewerProtocolPolicy
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. |
Fields
Name | Description |
---|---|
ALLOW_ALL | Both HTTP and HTTPS supported. |
HTTPS_ONLY | HTTPS only. |
REDIRECT_TO_HTTPS | Will redirect HTTP requests to HTTPS. |