Objective: Configure
index.htmlas the Default Root Object for the CloudFront DistributionStudentWebsiteDistribution(section 7.1) so that CloudFront automatically serves theindex.htmlfile from the S3 Bucketstudent-management-website-2025when users access the CloudFront domain (e.g., https://d12345678.cloudfront.net). This ensures the static web interface (form, student table, functional buttons) displays correctly and integrates with thestudentAPI (stageprod, section 4.8) to perform functions like saving, viewing, and backing up data.
index.html) that CloudFront returns when users access the root URL of the distribution (e.g., https://d12345678.cloudfront.net).index.html, styles.css, scripts.js, section 6.2) from the S3 Bucket student-management-website-2025 (sections 6.1–6.4) via Origin Access Identity (OAI) (section 7.1) to restrict access.student API (section 4.8) with the Invoke URL (e.g., https://abc123.execute-api.us-east-1.amazonaws.com/prod) and StudentApiKey (section 4.2).studentData and send a confirmation email via SES.student-backup-20250706 (section 6.5) and send notification emails via SES.You need to complete section 7.1 (create the CloudFront Distribution StudentWebsiteDistribution), section 6.1 (create the student-management-website-2025 bucket), section 6.2 (upload index.html, styles.css, scripts.js), section 6.3 (enable Static Website Hosting), section 6.4 (configure Bucket Policy), section 6.5 (configure the student-backup-20250706 bucket), section 5 (build the web interface), section 4.1 (create the student API), section 4.2 (create the StudentApiKey), section 4.3 (create the StudentUsagePlan), section 4.4 (create the GET /students method), section 4.5 (create the POST /students method), section 4.6 (create the /backup resource and POST /backup method), section 4.7 (enable CORS), section 4.8 (deploy the API to the prod stage), section 4.9 (link the StudentApiKey to StudentUsagePlan). Ensure your AWS account has cloudfront:UpdateDistribution, s3:GetObject, and the AWS region is us-east-1 for related services.
Access the AWS Management Console
student-management-website-2025, student API, Lambda, DynamoDB, and SES are in us-east-1.
Select the CloudFront Distribution
StudentWebsiteDistribution (created in section 7.1).
E... and the Domain name is of the format d12345678.cloudfront.net.
Edit Default Root Object
StudentWebsiteDistribution, select the General tab.
index.html.
index.html is the main file containing the web interface (input form, student table, save/view/backup functional buttons) uploaded to the S3 Bucket student-management-website-2025 (section 6.2). When users access the CloudFront domain, CloudFront will request index.html from S3 through OAI (section 7.1).index.html has been uploaded to the root directory of the S3 Bucket student-management-website-2025 (section 6.2).index.html as the Index document (section 6.3).{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontOAI",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity EXXXXXX"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::student-management-website-2025/*"
}
]
}
Save Changes


cloudfront:UpdateDistribution permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cloudfront:UpdateDistribution",
"Resource": "arn:aws:cloudfront::<AWS_ACCOUNT_ID>:distribution/<DISTRIBUTION_ID>"
}
]
}
<AWS_ACCOUNT_ID> and <DISTRIBUTION_ID> with actual values (found in CloudFront > Distributions).index.html in the General tab.Test Default Root Object
https://d12345678.cloudfront.net).styles.css and scripts.js files should load correctly over HTTPS, and the interface should display as expected.