Skip to content

Terraform module to configure a domain hosted on Route53 to work with AWS Simple Email Service (SES).

License

Notifications You must be signed in to change notification settings

umotif-public/terraform-aws-ses-domain

Repository files navigation

GitHub release (latest SemVer)

terraform-aws-ses-domain

Terraform module to configure a domain hosted on Route53 to work with AWS Simple Email Service (SES). Module supports both single and multi regional deployments.

These types of resources are created:

  • TXT record for SPF validation
  • Custom TXT record for SPF validation
  • Custom MAIL FROM domain
  • CNAME records for DKIM verification
  • SES Verfication for the domain
  • MX record pointing to AWS's SMTP endpoint

Terraform versions

Terraform 0.12 and 0.13. Pin module version to ~> v2.0. Submit pull-requests to master branch.

Usage

Application Load Balancer

module "ses-domain" {
  source = "umotif-public/ses-domain/aws"
  version = "~> 2.0.0"

  zone_id               = "Z2CBQCNDG7YEWJA"
  enable_verification   = true
  enable_incoming_email = true
}

Assumptions

Module is to be used with Terraform > 0.12.

Examples

Authors

Module managed by Marcin Cuber LinkedIn.

Requirements

Name Version
terraform >= 0.12.6
aws >= 2.41

Providers

Name Version
aws >= 2.41

Inputs

Name Description Type Default Required
additional_incoming_email_records List of additional records to be added to mx_receive Route53 record, e.g. "10 inbound-smtp.us-east-1.amazonses.com" list(string) [] no
additional_mail_from_records List of additional records to be added to mail_from_domain Route53 record, e.g. "10 feedback-smtp.us-east-1.amazonses.com" list(string) [] no
additional_verification_tokens List of additional verification SES domain tokens that will added to verfication Route53 record. list(string) [] no
enable_dkim_record Control whether or not to create route53 DNS record for SES DKIM. bool true no
enable_from_domain_record Control whether or not to create route53 DNS record for SES mail from domain. bool true no
enable_incoming_email_record Control whether or not to handle incoming emails string true no
enable_spf_record Control whether or not to set SPF records. bool true no
enable_verification Control whether or not to verify SES DNS records. bool true no
enable_verification_record Control whether or not to create route53 DNS record for SES domain verification. bool true no
spf_txt_record DNS TXT record for SPF to tell email providers which servers are allowed to send email from their domains. Variable is portion of the SPF TXT record. string "v=spf1 include:amazonses.com -all" no
zone_id Route53 Zone ID belonging to the desired domain string n/a yes

Outputs

Name Description
ses_domain_identity_verification_token SES domain verification token.
ses_identity_arn SES identity ARN.

License

See LICENSE for full details.

Pre-commit hooks

Install dependencies

MacOS

brew install pre-commit terraform-docs tflint

brew tap git-chglog/git-chglog
brew install git-chglog