This template creates three records for a mail server: an A record that specifies the IP address for the mail server, an MX record that routes email to that server, and a TXT record that contains an SPF string.

CloudFormation Template