# The specified default root object is not valid. The object must be in the distribution's origin.

- **ID:** `aws/cloudfront-invalid-default-root-object`
- **Domain:** aws
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The CloudFront distribution's Default Root Object (e.g., index.html) does not exist in the S3 bucket or custom origin at the root path.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| cloudfront-2024 | active | — | — |
| aws-cli/2.17.0 | active | — | — |
| s3-2024 | active | — | — |

## Workarounds

1. **Upload the default root object to the S3 bucket root: `aws s3 cp index.html s3://my-bucket/index.html` and ensure the bucket policy allows public read (if applicable).** (90% success)
   ```
   Upload the default root object to the S3 bucket root: `aws s3 cp index.html s3://my-bucket/index.html` and ensure the bucket policy allows public read (if applicable).
   ```
2. **If using a custom origin, place the file at the origin's root (e.g., /var/www/html/index.html for an EC2 web server).** (85% success)
   ```
   If using a custom origin, place the file at the origin's root (e.g., /var/www/html/index.html for an EC2 web server).
   ```

## Dead Ends

- **** — Setting the Default Root Object to a path with a leading slash (e.g., '/index.html') is invalid; CloudFront expects no leading slash. (80% fail)
- **** — Uploading the file to a subfolder instead of the bucket root won't work; the root object must be at the origin root. (90% fail)
