How to Configure CloudFront for Encryption in Transit?
Short answer
BE Set the Origin Protocol Policy setting to Match Viewer. Set the Viewer Protocol Policy setting to Redirect HTTP to HTTPS.
Question
Key Takeaways
Tests understanding of CloudFront's dual protocol policies to enforce encryption without creating caching loops or protocol mismatches.
Configuring Amazon CloudFront to encrypt data in transit requires aligning viewer and origin protocol policies. The community consensus confirms that combining redirect HTTP to HTTPS with match viewer ensures secure connections for all external requests.
Common mistake: Option A is frequently selected incorrectly because candidates confuse access restriction mechanisms with network-level transit encryption, which signed URLs do not provide.
Expert Analysis
Why the Answer Is Correct
Setting the Viewer Protocol Policy to Redirect HTTP to HTTPS guarantees that all client-to-CloudFront traffic is encrypted before reaching the edge. Pairing this with the Origin Protocol Policy set to Match Viewer instructs CloudFront to automatically use HTTPS when fetching content from the ALB, provided the viewer initially connected securely. This coordinated configuration fully satisfies the requirement to encrypt customer data in transit across both network segments.
Why the Other Options Are Wrong
Signed URLs restrict who can access specific resources but leave the underlying transport layer unencrypted. Field-level encryption only protects individual form fields inside POST payloads rather than securing the entire communication channel. Automatic object compression optimizes bandwidth for static assets like CSS or JavaScript files without adding any cryptographic protections. None of these alternatives address the fundamental need for transit encryption.
Community Comment Notes
Contributors consistently reference official AWS documentation to validate that Match Viewer must be paired with HTTPS redirection to prevent protocol errors while preserving cache efficiency [Comment 1]. Multiple users emphasize that CloudFront intelligently caches responses once regardless of whether the viewer originally used HTTP or HTTPS, making this pairing both secure and performant [Comment 2]. The discussion reinforces that selecting both options simultaneously creates a seamless encrypted pipeline from the internet to the ALB [Comment 3].
Official Reference
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always map security requirements to the specific CloudFront policy type they control, distinguishing between edge-to-client visibility and origin-fetching behavior. When encryption in transit is mandated, prioritize configurations that enforce HTTPS at the viewer level while dynamically matching protocols toward the backend to avoid unnecessary cache misses.
Community Votes
100% of anonymous learners picked answer BE. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 5 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 5
-
KarBiswa 👍 6https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-cloudfront-to-custom-origin.html
-
KennethNg923 👍 2B. Set the Origin Protocol Policy setting to Match Viewer. then if it is HTTP, Viewer Protocol Policy setting can Redirect HTTP to HTTPS (Option E).
-
aws_god 👍 1Choose Match Viewer only if you specify Redirect HTTP to HTTPS or HTTPS Only for Viewer Protocol Policy. CloudFront caches the object only once even if viewers make requests using both HTTP and HTTPS protocols. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-cloudfront-to-custom-origin.html
-
chigs508 👍 1a public discussion thread on this question
-
65703c1 👍 1BE is the correct answer.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →