viewerProtocolPolicy property
The protocol that viewers can use to access the files in the origin
specified by TargetOriginId
when a request matches the path
pattern in PathPattern
. You can specify the following options:
-
allow-all
: Viewers can use HTTP or HTTPS. -
redirect-to-https
: If a viewer submits an HTTP request, CloudFront returns an HTTP status code of 301 (Moved Permanently) to the viewer along with the HTTPS URL. The viewer then resubmits the request using the new URL. -
https-only
: If a viewer sends an HTTP request, CloudFront returns an HTTP status code of 403 (Forbidden).
Implementation
final ViewerProtocolPolicy viewerProtocolPolicy;