This template sets up an SESv2 email identity and configures Mail From attributes including behavior on MX failure and the mail from domain.

Terraform Template

resource "aws_sesv2_email_identity" "example" {
  email_identity = "example.com"
}

resource "aws_sesv2_email_identity_mail_from_attributes" "example" {
  behavior_on_mx_failure = "REJECT_MESSAGE"
  email_identity = aws_sesv2_email_identity.example.email_identity
  mail_from_domain = "subdomain.${aws_sesv2_email_identity.example.email_identity}"
}