Using AWS Route 53 and SES to handle DNS and e-mail
Some notes on using AWS for handling DNS and e-mail.
Task 1: example.com, www.example.com should go to some Cloudfront, and api.example.com should go to a Heroku app.
- Go to Route 53
- Create a hosted zone example.com
- At your domain registrar, change the DNS servers to those (4) now visible in Route 53.
- For each of the domains (example.com, www.example.com, api.example.com), create an A Name (IPv4 Alias) to your Cloudfront or ELBs and CNAME to your myexampleapp.herokuapps.com)
- The waiting game (DNS propagation can take hours)
Task 2: email@example.com should redirect to my gmail
Here are many options. Maybe the easiest (and best?) one is to point your MX to an e-mail server, e.g. at MailGun. It’s free (unless you’re doing massive traffic). If you instead wish to use AWS SES, they do not (out of the box) support forward emails. You’ll have to either
- Send receiving emails from AWS SES to AWS SNS.
- Major downside: Max ~250kb emails, or else they’ll bounce
- Forward receiving emails to AWS S3
- Downside: This is not want you want
- Forward to Lambda, which will forward your emails
- Downside (this solution anyway): It won’t encrypt the emails
If you wish to go with 3, here’s one way to do it:
- Go to SES
- Add Domains > Verify a New Domain > Enter your domain
- Add Email Addresses > Verify a new Email Address > Enter the email address you want forwarded to
- Follow https://github.com/arithmetric/aws-lambda-ses-forwarder