Mail From Args
Provides an SES domain MAIL FROM resource.
NOTE: For the MAIL FROM domain to be fully usable, this resource should be paired with the aws.ses.DomainIdentity resource. To validate the MAIL FROM domain, a DNS MX record is required. To pass SPF checks, a DNS TXT record may also be required. See the Amazon SES MAIL FROM documentation for more information.
Example Usage
Domain Identity MAIL FROM
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ses.DomainIdentity;
import com.pulumi.aws.ses.DomainIdentityArgs;
import com.pulumi.aws.ses.MailFrom;
import com.pulumi.aws.ses.MailFromArgs;
import com.pulumi.aws.route53.Record;
import com.pulumi.aws.route53.RecordArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleDomainIdentity = new DomainIdentity("exampleDomainIdentity", DomainIdentityArgs.builder()
.domain("example.com")
.build());
var exampleMailFrom = new MailFrom("exampleMailFrom", MailFromArgs.builder()
.domain(exampleDomainIdentity.domain())
.mailFromDomain(exampleDomainIdentity.domain().applyValue(domain -> String.format("bounce.%s", domain)))
.build());
var exampleSesDomainMailFromMx = new Record("exampleSesDomainMailFromMx", RecordArgs.builder()
.zoneId(aws_route53_zone.example().id())
.name(exampleMailFrom.mailFromDomain())
.type("MX")
.ttl("600")
.records("10 feedback-smtp.us-east-1.amazonses.com")
.build());
var exampleSesDomainMailFromTxt = new Record("exampleSesDomainMailFromTxt", RecordArgs.builder()
.zoneId(aws_route53_zone.example().id())
.name(exampleMailFrom.mailFromDomain())
.type("TXT")
.ttl("600")
.records("v=spf1 include:amazonses.com -all")
.build());
}
}
Email Identity MAIL FROM
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ses.EmailIdentity;
import com.pulumi.aws.ses.EmailIdentityArgs;
import com.pulumi.aws.ses.MailFrom;
import com.pulumi.aws.ses.MailFromArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleEmailIdentity = new EmailIdentity("exampleEmailIdentity", EmailIdentityArgs.builder()
.email("user@example.com")
.build());
var exampleMailFrom = new MailFrom("exampleMailFrom", MailFromArgs.builder()
.domain(exampleEmailIdentity.email())
.mailFromDomain("mail.example.com")
.build());
}
}
Import
MAIL FROM domain can be imported using the domain
attribute, e.g.,
$ pulumi import aws:ses/mailFrom:MailFrom example example.com
Properties
The action that you want Amazon SES to take if it cannot successfully read the required MX record when you send an email. Defaults to UseDefaultValue
. See the SES API documentation for more information.
Subdomain (of above domain) which is to be used as MAIL FROM address (Required for DMARC validation) The following arguments are optional: