Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cloudformation template for fastmail MX/SPF/DKIM records described on https://www.fastmail.com/help/receive/domains-setup-mxonly.html
Parameters:
Domain:
Description: Domain for hosted zone, e.g. example.com
Type: String
Resources:
WebHostedZone:
Type: AWS::Route53::HostedZone
Properties:
Name: !Ref Domain
WebMailRecordSetGroup:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: !Ref WebHostedZone
RecordSets:
- Name: !Ref Domain
TTL: 21600
Type: MX
ResourceRecords:
- 10 in1-smtp.messagingengine.com
- 20 in2-smtp.messagingengine.com
- Name: !Ref Domain
TTL: 21600
Type: TXT
ResourceRecords:
- "\"v=spf1 include:spf.messagingengine.com ?all\""
- Name: !Join ["", ["fm1._domainkey.", !Ref Domain]]
TTL: 21600
Type: CNAME
ResourceRecords:
- !Join ["", ["fm1.", !Ref Domain, ".dkim.fmhosted.com"]]
- Name: !Join ["", ["fm2._domainkey.", !Ref Domain]]
TTL: 21600
Type: CNAME
ResourceRecords:
- !Join ["", ["fm2.", !Ref Domain, ".dkim.fmhosted.com"]]
- Name: !Join ["", ["fm3._domainkey.", !Ref Domain]]
TTL: 21600
Type: CNAME
ResourceRecords:
- !Join ["", ["fm3.", !Ref Domain, ".dkim.fmhosted.com"]]
Outputs:
HostedZoneId:
Description: Hosted Zone ID
Value: !Ref WebHostedZone
WebMailDomain:
Description: Mail RecordSetGroup Domain Name
Value: !Ref WebMailRecordSetGroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment