Objective: Test the entire serverless system, including the web interface (served via CloudFront
StudentWebsiteDistribution), student data saving functionality (POST /students), viewing the student list (GET /students), sending notification emails via Amazon SES, and automatic backup from DynamoDBstudentDatato the S3 Bucketstudent-backup-20250706. Ensure the system works correctly from frontend to backend, notification emails, and automated backup.
StudentWebsiteDistribution (sections 7.1–7.3) from S3 Bucket student-management-website-2025 (sections 6.1–6.4).studentid, name, class, birthdate, email) and the data table.student API (stage prod, section 4.8) with Invoke URL (e.g., https://abc123.execute-api.us-east-1.amazonaws.com/prod) and StudentApiKey (section 4.2).insertStudentData (section 3.2) saves records to DynamoDB studentData and sends emails via SES.getStudentData (section 3.1) retrieves data from DynamoDB.DynamoDBBackup (section 8.1) saves a JSON file to S3 student-backup-20250706 and sends notification emails.DailyDynamoDBBackup (section 8.2) triggers DynamoDBBackup daily at 07:00 AM +07.https://d12345678.cloudfront.net).DynamoDBBackupRoleStudent (section 6.5) grants permissions for DynamoDB, S3, SES.no-reply@studentapp.com, admin@studentapp.com).You need to complete:
student-backup-20250706.getStudentData, insertStudentData, DynamoDBBackup with role DynamoDBBackupRoleStudent.student API, StudentApiKey, StudentUsagePlan, methods GET /students, POST /students, POST /backup, enable CORS, deploy the prod stage.index.html, styles.css, scripts.js).student-management-website-2025, student-backup-20250706.StudentWebsiteDistribution.DynamoDBBackup, EventBridge Rule DailyDynamoDBBackup.dynamodb:Scan, dynamodb:PutItem, s3:GetObject, s3:PutObject, ses:SendEmail, and the AWS region is us-east-1.Access the Website via CloudFront Domain Name
https://d12345678.cloudfront.net) from CloudFront > Distributions > StudentWebsiteDistribution (section 7.3).studentid, name, class, birthdate, email) and the Save, View All Students buttons, styled with Tailwind CSS (section 5).

Enter and Save Student Information
SV006Nguyen Van FCNTT062001-06-06student6@example.com
Confirm Successful Save Notification
scripts.js).alert() or a Tailwind CSS-styled div).insertStudentData function returns:
{ "statusCode": 200, "body": "{\"message\": \"Lưu thành công\"}" }

View Student List
getStudentData function (section 3.1) retrieves data from studentData.SV006) and other records, with fields: studentid, name, class, birthdate, email.
Check Student Notification Email
student6@example.com to check the email from SES.no-reply@studentapp.com with:
Hello Nguyen Van F,
Your information has been successfully saved:
- Student ID: SV006
- Class: CNTT06
- Birthdate: 2001-06-06
- Email: student6@example.com
no-reply@studentapp.com, student6@example.com in SES (section 3).ses:SendEmail permission in DynamoDBBackupRoleStudent.
Check Data in DynamoDB
{
"studentid": "SV006",
"name": "Nguyen Van F",
"class": "CNTT06",
"birthdate": "2001-06-06",
"email": "student6@example.com"
}
/aws/lambda/insertStudentData logs (section 10) or dynamodb:PutItem permission.
Check Admin Backup Notification Email
admin@studentapp.com to check the backup email from SES (sent by DynamoDBBackup, section 8.1).no-reply@studentapp.com with:
DynamoDBBackup runs (manually via POST /backup or automatically via DailyDynamoDBBackup at 07:00 AM +07, section 8.2).ses:SendEmail permission./aws/lambda/DynamoDBBackup logs (section 10).
Check Backup File in S3
backup/ folder and check the JSON file (e.g., students-backup-20250709T0700.json).studentData, including the SV006 record./aws/lambda/DynamoDBBackup logs or s3:PutObject permission in DynamoDBBackupRoleStudent.DailyDynamoDBBackup (section 8.2) runs on schedule.
| Factor | Details |
|---|---|
| Security | - Do not embed StudentApiKey in scripts.js. Use CloudFront Functions: javascript <br> function handler(event) { <br> var request = event.request; <br> request.headers['x-api-key'] = { value: 'xxxxxxxxxxxxxxxxxxxx' }; <br> return request; <br> } <br> - Verify SES emails (no-reply@studentapp.com, admin@studentapp.com, student6@example.com). |
| Optimization | - Check CloudWatch Logs (section 10) for performance analysis. - Use AWS CLI to test API: bash <br> aws apigateway test-invoke-method --rest-api-id abc123 --resource-id xxxxx --http-method POST --path-with-query-string /students --body '{"studentid":"SV006","name":"Nguyen Van F","class":"CNTT06","birthdate":"2001-06-06","email":"student6@example.com"}' <br> |
| Integration | - Ensure CORS in API Gateway (section 4.7): Access-Control-Allow-Origin: https://d12345678.cloudfront.net. - Test all endpoints (POST /students, GET /students, POST /backup) via CloudFront URL. |
| Integration Testing | - Access https://d12345678.cloudfront.net: - POST /students: Save record, send SES email. - GET /students: Display table. - POST /backup: Create JSON file, send email. - Use Developer Tools > Network to inspect API requests. |
| Error Handling | - Interface error: Check index.html, scripts.js in S3 student-management-website-2025. - API error: Check /aws/lambda/insertStudentData, /aws/lambda/getStudentData logs. - Backup error: Verify DailyDynamoDBBackup and /aws/lambda/DynamoDBBackup logs. - Email error: Check SES email and ses:SendEmail permission. |
Best practice tip: Test each function via the web interface. Check CloudWatch Logs (section 10) for debugging. Set S3 Lifecycle Rule for
student-backup-20250706to manage old files.
The serverless system works correctly: the web interface loads via CloudFront, POST /students saves data and sends emails, GET /students displays the list, POST /backup and DailyDynamoDBBackup create JSON files in S3, and notification emails are sent successfully. Everything is smoothly integrated with the student API and SES.
Next step: Go to View Activity Logs with CloudWatch for detailed analysis