DVA-C02 · Question #34
A developer is testing a new file storage application that uses an Amazon CloudFront distribution to serve content from an Amazon S3 bucket. The distribution accesses the S3 bucket by using an…
The correct answer is A. Add a second cache behavior to the distribution with the same origin as the default cache. By adding a second cache behavior with unrestricted viewer access to the login page's path pattern, unauthenticated users will be allowed to access the login page. At the same time, the default cache behavior's settings remain unchanged, and private content remains secure…
Question
A developer is testing a new file storage application that uses an Amazon CloudFront distribution to serve content from an Amazon S3 bucket. The distribution accesses the S3 bucket by using an origin access identity (OAI). The S3 bucket's permissions explicitly deny access to all other users. The application prompts users to authenticate on a login page and then uses signed cookies to allow users to access their personal storage directories. The developer has configured the distribution to use its default cache behavior with restricted viewer access and has set the origin to point to the S3 bucket. However, when the developer tries to navigate to the login page, the developer receives a 403 Forbidden error. The developer needs to implement a solution to allow unauthenticated access to the login page. The solution also must keep all private content secure. Which solution will meet these requirements?
Options
- AAdd a second cache behavior to the distribution with the same origin as the default cache
- BAdd a second cache behavior to the distribution with the same origin as the default cache
- CAdd a second origin as a failover origin to the default cache behavior. Point the failover origin to
- DAdd a bucket policy to the S3 bucket to allow read access. Set the resource on the policy to the
How the community answered
(24 responses)- A58% (14)
- B25% (6)
- C4% (1)
- D13% (3)
Explanation
By adding a second cache behavior with unrestricted viewer access to the login page's path pattern, unauthenticated users will be allowed to access the login page. At the same time, the default cache behavior's settings remain unchanged, and private content remains secure because it still requires signed cookies for access. If you create additional cache behaviors, the default cache behavior is always the last to be https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values- specify.html#DownloadDistValuesCacheBehavior
Community Discussion
No community discussion yet for this question.