This repository includes Terraform code to provision resources to enable redirection of requests for a CloudFront distribution, along with the code to perform the redirects in Lambda and manage redirects at the command line.
Right now I don't recommend importing this code as a Terraform module, but it may be useful as reference.