Setting up Cloudfront as a reverse proxy for domain redirection

Although In my current solution im using an A record alias for both non-www and www (pointing to same cloudfront distro). So im not necessarily doing the redirect from non-www to www