How Do You Enforce HTTPS for a CloudFront Custom Domain on AWS?
Short answer
AC Redirect viewers from HTTP to HTTPS on each cache behavior and attach www.example.com as an alternate domain name with the ACM certificate.
Question
Which combination of steps should a CloudOps engineer take to encrypt the traffic in transit? (Choose two.)
Key Takeaways
The exam tests that HTTPS on CloudFront is a two-part configuration — a matching custom certificate on an alternate domain name plus a per-cache-behavior Viewer Protocol Policy — and the trap is assuming one of the two alone secures viewer traffic.
CloudFront encrypts viewer traffic only when the distribution serves a valid certificate for www.example.com and every cache behavior refuses plain HTTP. This page confirms that the required pair of steps is creating the alternate domain name with the ACM certificate and setting each Viewer Protocol Policy to redirect HTTP to HTTPS.
Common mistake: Choosing option B because 'allow HTTP and HTTPS' sounds flexible; it still permits unencrypted requests to reach CloudFront, so it fails the requirement that all traffic be encrypted in transit.
Expert Analysis
Why the Answer Is Correct
CloudFront encrypts traffic between viewers and edge locations only if two independent things are true, and options A and C supply exactly those two things. Option C attaches www.example.com to the distribution as an alternate domain name (CNAME) and binds the ACM-issued custom certificate, so the edge can complete a TLS handshake for that hostname instead of falling back to the default *.cloudfront.net certificate. Option A then forces the protocol decision at the edge: setting the Viewer Protocol Policy to Redirect HTTP to HTTPS on every cache behavior guarantees no viewer can complete a request over plaintext HTTP. Because CloudFront evaluates Viewer Protocol Policy per cache behavior, the setting must be applied to all of them, which is why the option is phrased 'for each cache behavior'. Together, C makes HTTPS possible for the custom domain and A makes it mandatory, which is precisely the requirement that all traffic be encrypted in transit. Community member Bad_Mat reached the same conclusion, stating "The correct combination of steps is A and C."
Why the Other Options Are Wrong
Option B is the classic distractor: allowing both HTTP and HTTPS leaves an unencrypted path open, so any viewer (or an attacker rewriting links) can still send cleartext requests, violating the 'all traffic must be encrypted' requirement. Option D is unrelated to transport encryption — an AWS WAF web ACL filters malicious requests at layer 7 and does not change the TLS or HTTP/HTTPS behavior of the distribution. Option E is also unrelated: Origin Shield adds a centralized caching layer between edge locations and the origin to reduce origin load and improve cache hit ratio, but it has no effect on the viewer-to-edge protocol. Neither D nor E supplies the certificate binding or the HTTP-to-HTTPS redirect that the scenario demands.
Community Comment Notes
The only recorded learner input on this item, from Bad_Mat, endorses the same pairing of steps (A and C), which matches what the CloudFront console actually enforces. That agreement is a sanity check rather than the reason to choose: the decisive evidence is that the scenario names an existing ACM certificate for www.example.com, which is otherwise unusable unless the hostname is added as an alternate domain name. Note also that ACM certificates used with CloudFront must reside in us-east-1, a detail worth remembering when a scenario mentions a certificate that will not attach.
Official Reference
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMES.html
These links open the official vendor documentation in a new tab.
Exam Strategy
When a CloudFront requirement mentions encryption in transit for a custom domain, immediately look for the pair: redirect HTTP to HTTPS on the cache behaviors plus an alternate domain name bound to the ACM certificate. Eliminate any option about WAF, Origin Shield, or 'allow HTTP and HTTPS' before you start weighing the remaining choices.
Frequently Asked Questions
Why is 'allow HTTP and HTTPS' wrong for a CloudFront distribution that must be encrypted?
Why must www.example.com be added as an alternate domain name instead of just using the ACM certificate?
Discussion 1 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 1
-
Bad_Mat 👍 1The correct combination of steps is A and C.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All SOA-C03 Questions
Access 100 questions with complete answers and detailed explanations.
View Full SOA-C03 Practice Test →