exam questions

Exam AWS Certified Developer Associate All Questions

View all questions & answers for the AWS Certified Developer Associate exam

Exam AWS Certified Developer Associate topic 1 question 296 discussion

Exam question from Amazon's AWS Certified Developer Associate
Question #: 296
Topic #: 1
[All AWS Certified Developer Associate Questions]

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?

  • A. Add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to the path of the login page, and make viewer access unrestricted. Keep the default cache behavior’s settings unchanged.
  • B. Add a second cache behavior to the distribution with the same origin as the default cache behavior. Set the path pattern for the second cache behavior to *, and make viewer access restricted. Change the default cache behavior's path pattern to the path of the login page, and make viewer access unrestricted.
  • C. Add a second origin as a failover origin to the default cache behavior. Point the failover origin to the S3 bucket. Set the path pattern for the primary origin to * and make viewer access restricted. Set the path pattern for the failover origin to the path of the login page, and make viewer access unrestricted.
  • D. Add a bucket policy to the S3 bucket to allow read access. Set the resource on the policy to the Amazon Resource Name (ARN) of the login page object in the S3 bucket. Add a CloudFront function to the default cache behavior to redirect unauthorized requests to the login page’s S3 URI.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
akbiyik
2 years, 2 months ago
Selected Answer: A
AAAAAAA
upvoted 2 times
...
by116549
2 years, 4 months ago
The question states "The developer has configured the distribution to use its default cache behaviour with restricted viewer access and has set the origin to point to the S3 bucket" This rules out C and D. Checking this resource: https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CacheBehavior.html "The path pattern for the default cache behavior is * and cannot be changed. If the request for an object does not match the path pattern for any cache behaviors, CloudFront applies the behavior in the default cache behavior." Seems A is correct
upvoted 4 times
...
xicomynor
2 years, 4 months ago
Selected Answer: A
A. A and B is almost the same but default cache behavior's path cannot be changed. https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CacheBehavior.html
upvoted 2 times
...
mrbig00
2 years, 4 months ago
Selected Answer: B
The correct solution is option B. Adding a second cache behavior to the distribution with the same origin as the default cache behavior and setting the path pattern to * will allow access to all files in the S3 bucket. Changing the default cache behavior's path pattern to the path of the login page and making viewer access unrestricted will allow unauthenticated users to access the login page, while keeping all other private content secure.
upvoted 1 times
xicomynor
2 years, 4 months ago
A and B is almost the same, except that default cache behavior's path cannot be changed. So the second cache behavior needs to be the login path and make it unrestricted and then leave the default as it is. So my answer is A
upvoted 2 times
...
...
michaldavid
2 years, 5 months ago
Selected Answer: A
I think this is A
upvoted 2 times
...
k1kavi1
2 years, 5 months ago
Selected Answer: C
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html
upvoted 2 times
xicomynor
2 years, 4 months ago
Question is not about high availability. Both resources are "available" but not for unauthorized users.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago