Resource: aws_ses_domain_mail_from

Provides an SES domain MAIL FROM resource.

Example Usage

Domain Identity MAIL FROM

resource "aws_ses_domain_mail_from" "example" {
  domain           = aws_ses_domain_identity.example.domain
  mail_from_domain = "bounce.${aws_ses_domain_identity.example.domain}"
}

# Example SES Domain Identity
resource "aws_ses_domain_identity" "example" {
  domain = "example.com"
}

# Example Route53 MX record
resource "aws_route53_record" "example_ses_domain_mail_from_mx" {
  zone_id = aws_route53_zone.example.id
  name    = aws_ses_domain_mail_from.example.mail_from_domain
  type    = "MX"
  ttl     = "600"
  records = ["10 feedback-smtp.us-east-1.amazonses.com"] # Change to the region in which `aws_ses_domain_identity.example` is created
}

# Example Route53 TXT record for SPF
resource "aws_route53_record" "example_ses_domain_mail_from_txt" {
  zone_id = aws_route53_zone.example.id
  name    = aws_ses_domain_mail_from.example.mail_from_domain
  type    = "TXT"
  ttl     = "600"
  records = ["v=spf1 include:amazonses.com -all"]
}

Email Identity MAIL FROM

# Example SES Email Identity
resource "aws_ses_email_identity" "example" {
  email = "user@example.com"
}

resource "aws_ses_domain_mail_from" "example" {
  domain           = aws_ses_email_identity.example.email
  mail_from_domain = "mail.example.com"
}

Argument Reference

The following arguments are required:

The following arguments are optional:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import MAIL FROM domain using the domain attribute. For example:

import {
  to = aws_ses_domain_mail_from.example
  id = "example.com"
}

Using terraform import, import MAIL FROM domain using the domain attribute. For example:

% terraform import aws_ses_domain_mail_from.example example.com