@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
120 lines • 4.87 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MailFrom = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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](https://docs.aws.amazon.com/ses/latest/dg/mail-from.html) for more information.
*
* ## Example Usage
*
* ### Domain Identity MAIL FROM
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Example SES Domain Identity
* const exampleDomainIdentity = new aws.ses.DomainIdentity("example", {domain: "example.com"});
* const example = new aws.ses.MailFrom("example", {
* domain: exampleDomainIdentity.domain,
* mailFromDomain: pulumi.interpolate`bounce.${exampleDomainIdentity.domain}`,
* });
* // Example Route53 MX record
* const exampleSesDomainMailFromMx = new aws.route53.Record("example_ses_domain_mail_from_mx", {
* zoneId: exampleAwsRoute53Zone.id,
* name: example.mailFromDomain,
* type: aws.route53.RecordType.MX,
* ttl: 600,
* records: ["10 feedback-smtp.us-east-1.amazonses.com"],
* });
* // Example Route53 TXT record for SPF
* const exampleSesDomainMailFromTxt = new aws.route53.Record("example_ses_domain_mail_from_txt", {
* zoneId: exampleAwsRoute53Zone.id,
* name: example.mailFromDomain,
* type: aws.route53.RecordType.TXT,
* ttl: 600,
* records: ["v=spf1 include:amazonses.com ~all"],
* });
* ```
*
* ### Email Identity MAIL FROM
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* // Example SES Email Identity
* const example = new aws.ses.EmailIdentity("example", {email: "user@example.com"});
* const exampleMailFrom = new aws.ses.MailFrom("example", {
* domain: example.email,
* mailFromDomain: "mail.example.com",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import MAIL FROM domain using the `domain` attribute. For example:
*
* ```sh
* $ pulumi import aws:ses/mailFrom:MailFrom example example.com
* ```
*/
class MailFrom extends pulumi.CustomResource {
/**
* Get an existing MailFrom resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new MailFrom(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of MailFrom. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === MailFrom.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["behaviorOnMxFailure"] = state?.behaviorOnMxFailure;
resourceInputs["domain"] = state?.domain;
resourceInputs["mailFromDomain"] = state?.mailFromDomain;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.domain === undefined && !opts.urn) {
throw new Error("Missing required property 'domain'");
}
if (args?.mailFromDomain === undefined && !opts.urn) {
throw new Error("Missing required property 'mailFromDomain'");
}
resourceInputs["behaviorOnMxFailure"] = args?.behaviorOnMxFailure;
resourceInputs["domain"] = args?.domain;
resourceInputs["mailFromDomain"] = args?.mailFromDomain;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MailFrom.__pulumiType, name, resourceInputs, opts);
}
}
exports.MailFrom = MailFrom;
/** @internal */
MailFrom.__pulumiType = 'aws:ses/mailFrom:MailFrom';
//# sourceMappingURL=mailFrom.js.map