There are more AWS SDK examples available in the AWS Doc SDK Examples
Add index.html to request URLs without a file name in a CloudFront Functions viewer request event
The following code example shows how to add index.html to request URLs without a file name in a CloudFront Functions viewer request event.