{Viewer,Origin} {Request,Response} events on CloudFront

Hi there,

I’ve noticed Lambda Function Associations in my Cloudfront’s console under Edit Behavior.

Are there any serverless examples of what can be done with this? I am wondering if I can for e.g. redirect www.example.com to example.com. “www to naked domain” without going the S3 Website and another CF distribution rigamarole.

Thanks!