import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * With Auth0, you can have standard welcome, password reset, and account verification email-based workflows built right into Auth0. This resource allows you to configure email providers, so you can route all emails that are part of Auth0's authentication workflows through the supported high-volume email service of your choice. * * !> This resource manages to create a max of 1 email provider for a tenant. * To avoid potential issues, it is recommended not to try creating multiple email providers on the same tenant. * * !> If you are using the `auth0.EmailProvider` resource to create a `custom` email provider, you must ensure an action is created first with `custom-email-provider` as the supportedTriggers * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as auth0 from "@pulumi/auth0"; * * // This is an example on how to set up the email provider with Amazon SES. * const amazonSesEmailProvider = new auth0.EmailProvider("amazon_ses_email_provider", { * name: "ses", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: { * accessKeyId: "AKIAXXXXXXXXXXXXXXXX", * secretAccessKey: "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", * region: "us-east-1", * }, * }); * // This is an example on how to set up the email provider with SMTP. * const smtpEmailProvider = new auth0.EmailProvider("smtp_email_provider", { * name: "smtp", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: { * smtpHost: "your.smtp.host.com", * smtpPort: 583, * smtpUser: "SMTP Username", * smtpPass: "SMTP Password", * }, * }); * // This is an example on how to set up the email provider with Sendgrid. * const sendgridEmailProvider = new auth0.EmailProvider("sendgrid_email_provider", { * name: "sendgrid", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: { * apiKey: "secretAPIKey", * }, * }); * // This is an example on how to set up the email provider with Azure CS. * const azureCsEmailProvider = new auth0.EmailProvider("azure_cs_email_provider", { * name: "azure_cs", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: { * azureCsConnectionString: "azure_cs_connection_string", * }, * }); * // This is an example on how to set up the email provider with MS365. * const ms365EmailProvider = new auth0.EmailProvider("ms365_email_provider", { * name: "ms365", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: { * ms365TenantId: "ms365_tenant_id", * ms365ClientId: "ms365_client_id", * ms365ClientSecret: "ms365_client_secret", * }, * }); * // Below is an example of how to set up a custom email provider. * // The action with custom-email-provider as supported_triggers is a prerequisite. * const customEmailProviderAction = new auth0.Action("custom_email_provider_action", { * name: "custom-email-provider-action", * runtime: "node22", * deploy: true, * code: `/** * * Handler to be executed while sending an email notification. * * * * @param {Event} event - Details about the user and the context in which they are logging in. * * @param {CustomEmailProviderAPI} api - Methods and utilities to help change the behavior of sending a email notification. * */ * exports.onExecuteCustomEmailProvider = async (event, api) => { * // Code goes here * console.log(event); * return; * }; * `, * supportedTriggers: { * id: "custom-email-provider", * version: "v1", * }, * }); * const customEmailProvider = new auth0.EmailProvider("custom_email_provider", { * name: "custom", * enabled: true, * defaultFromAddress: "accounts@example.com", * credentials: {}, * }, { * dependsOn: [customEmailProviderAction], * }); * ``` * * ## Import * * As this is not a resource identifiable by an ID within the Auth0 Management API, * * email can be imported using a random string. * * We recommend [Version 4 UUID](https://www.uuidgenerator.net/version4) * * Example: * * ```sh * $ pulumi import auth0:index/emailProvider:EmailProvider my_email_provider "b4213dc2-2eed-42c3-9516-c6131a9ce0b0" * ``` */ export declare class EmailProvider extends pulumi.CustomResource { /** * Get an existing EmailProvider 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: string, id: pulumi.Input, state?: EmailProviderState, opts?: pulumi.CustomResourceOptions): EmailProvider; /** * Returns true if the given object is an instance of EmailProvider. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is EmailProvider; /** * Configuration settings for the credentials for the email provider. */ readonly credentials: pulumi.Output; /** * Email address to use as the sender when no other "from" address is specified. */ readonly defaultFromAddress: pulumi.Output; /** * Indicates whether the email provider is enabled. */ readonly enabled: pulumi.Output; /** * Name of the email provider. Options include `azureCs`, `custom`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. */ readonly name: pulumi.Output; /** * Specific email provider settings. */ readonly settings: pulumi.Output; /** * Create a EmailProvider resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: EmailProviderArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EmailProvider resources. */ export interface EmailProviderState { /** * Configuration settings for the credentials for the email provider. */ credentials?: pulumi.Input; /** * Email address to use as the sender when no other "from" address is specified. */ defaultFromAddress?: pulumi.Input; /** * Indicates whether the email provider is enabled. */ enabled?: pulumi.Input; /** * Name of the email provider. Options include `azureCs`, `custom`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. */ name?: pulumi.Input; /** * Specific email provider settings. */ settings?: pulumi.Input; } /** * The set of arguments for constructing a EmailProvider resource. */ export interface EmailProviderArgs { /** * Configuration settings for the credentials for the email provider. */ credentials: pulumi.Input; /** * Email address to use as the sender when no other "from" address is specified. */ defaultFromAddress: pulumi.Input; /** * Indicates whether the email provider is enabled. */ enabled?: pulumi.Input; /** * Name of the email provider. Options include `azureCs`, `custom`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. */ name?: pulumi.Input; /** * Specific email provider settings. */ settings?: pulumi.Input; }