nerdexam
Amazon

DVA-C02 · Question #295

A developer creates a static website for their department. The developer deploys the static assets for the website to an Amazon S3 bucket and serves the assets with Amazon CloudFront. The developer us

The correct answer is C. Create a CloudFront function that examines the request URL and appends index.html when. https://aws.amazon.com/blogs/networking-and-content-delivery/implementing-default-directory- indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-cloudfront-functions/

Submitted by tunde_lagos· Mar 5, 2026Development with AWS Services

Question

A developer creates a static website for their department. The developer deploys the static assets for the website to an Amazon S3 bucket and serves the assets with Amazon CloudFront. The developer uses origin access control (OAC) on the CloudFront distribution to access the S3 bucket. The developer notices users can access the root URL and specific pages but cannot access directories without specifying a file name. For example, /products/index.html works, but /products/ returns an error. The developer needs to enable accessing directories without specifying a file name without exposing the S3 bucket publicly. Which solution will meet these requirements?

Options

  • AUpdate the CloudFront distribution's settings to index.html as the default root object is set.
  • BUpdate the Amazon S3 bucket settings and enable static website hosting. Specify index.html as
  • CCreate a CloudFront function that examines the request URL and appends index.html when
  • DCreate a custom error response on the CloudFront distribution with the HTTP error code set to

How the community answered

(25 responses)
  • A
    8% (2)
  • B
    20% (5)
  • C
    48% (12)
  • D
    24% (6)

Explanation

https://aws.amazon.com/blogs/networking-and-content-delivery/implementing-default-directory- indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-cloudfront-functions/

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice