enum ViewerProtocolPolicy
| Language | Type name | 
|---|---|
|  .NET | Amazon.CDK.AWS.CloudFront.ViewerProtocolPolicy | 
|  Go | github.com/aws/aws-cdk-go/awscdk/v2/awscloudfront#ViewerProtocolPolicy | 
|  Java | software.amazon.awscdk.services.cloudfront.ViewerProtocolPolicy | 
|  Python | aws_cdk.aws_cloudfront.ViewerProtocolPolicy | 
|  TypeScript (source) | aws-cdk-lib»aws_cloudfront»ViewerProtocolPolicy | 
How HTTPs should be handled with your distribution.
Example
// Create a Distribution with configured HTTP methods and viewer protocol policy of the cache.
declare const myBucket: s3.Bucket;
const myWebDistribution = new cloudfront.Distribution(this, 'myDist', {
  defaultBehavior: {
    origin: new origins.S3Origin(myBucket),
    allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,
    viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
  },
});
Members
| Name | Description | 
|---|---|
| HTTPS_ONLY | HTTPS only. | 
| REDIRECT_TO_HTTPS | Will redirect HTTP requests to HTTPS. | 
| ALLOW_ALL | Both HTTP and HTTPS supported. | 
HTTPS_ONLY
HTTPS only.
REDIRECT_TO_HTTPS
Will redirect HTTP requests to HTTPS.
ALLOW_ALL
Both HTTP and HTTPS supported.
