auth0.Email
Explore with Pulumi AI
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.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Auth0 = Pulumi.Auth0;
return await Deployment.RunAsync(() =>
{
// This is an example on how to set up the email provider with Amazon SES.
var amazonSesEmailProvider = new Auth0.Email("amazonSesEmailProvider", new()
{
Credentials = new Auth0.Inputs.EmailCredentialsArgs
{
AccessKeyId = "AKIAXXXXXXXXXXXXXXXX",
Region = "us-east-1",
SecretAccessKey = "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
DefaultFromAddress = "accounts@example.com",
Enabled = true,
});
// This is an example on how to set up the email provider with SMTP.
var smtpEmailProvider = new Auth0.Email("smtpEmailProvider", new()
{
Credentials = new Auth0.Inputs.EmailCredentialsArgs
{
SmtpHost = "your.smtp.host.com",
SmtpPass = "SMTP Password",
SmtpPort = 583,
SmtpUser = "SMTP Username",
},
DefaultFromAddress = "accounts@example.com",
Enabled = true,
});
// This is an example on how to set up the email provider with Sendgrid.
var sendgridEmailProvider = new Auth0.Email("sendgridEmailProvider", new()
{
Credentials = new Auth0.Inputs.EmailCredentialsArgs
{
ApiKey = "secretAPIKey",
},
DefaultFromAddress = "accounts@example.com",
Enabled = true,
});
});
package main
import (
"github.com/pulumi/pulumi-auth0/sdk/v2/go/auth0"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := auth0.NewEmail(ctx, "amazonSesEmailProvider", &auth0.EmailArgs{
Credentials: &auth0.EmailCredentialsArgs{
AccessKeyId: pulumi.String("AKIAXXXXXXXXXXXXXXXX"),
Region: pulumi.String("us-east-1"),
SecretAccessKey: pulumi.String("7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
},
DefaultFromAddress: pulumi.String("accounts@example.com"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = auth0.NewEmail(ctx, "smtpEmailProvider", &auth0.EmailArgs{
Credentials: &auth0.EmailCredentialsArgs{
SmtpHost: pulumi.String("your.smtp.host.com"),
SmtpPass: pulumi.String("SMTP Password"),
SmtpPort: pulumi.Int(583),
SmtpUser: pulumi.String("SMTP Username"),
},
DefaultFromAddress: pulumi.String("accounts@example.com"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = auth0.NewEmail(ctx, "sendgridEmailProvider", &auth0.EmailArgs{
Credentials: &auth0.EmailCredentialsArgs{
ApiKey: pulumi.String("secretAPIKey"),
},
DefaultFromAddress: pulumi.String("accounts@example.com"),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.auth0.Email;
import com.pulumi.auth0.EmailArgs;
import com.pulumi.auth0.inputs.EmailCredentialsArgs;
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 amazonSesEmailProvider = new Email("amazonSesEmailProvider", EmailArgs.builder()
.credentials(EmailCredentialsArgs.builder()
.accessKeyId("AKIAXXXXXXXXXXXXXXXX")
.region("us-east-1")
.secretAccessKey("7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build())
.defaultFromAddress("accounts@example.com")
.enabled(true)
.build());
var smtpEmailProvider = new Email("smtpEmailProvider", EmailArgs.builder()
.credentials(EmailCredentialsArgs.builder()
.smtpHost("your.smtp.host.com")
.smtpPass("SMTP Password")
.smtpPort(583)
.smtpUser("SMTP Username")
.build())
.defaultFromAddress("accounts@example.com")
.enabled(true)
.build());
var sendgridEmailProvider = new Email("sendgridEmailProvider", EmailArgs.builder()
.credentials(EmailCredentialsArgs.builder()
.apiKey("secretAPIKey")
.build())
.defaultFromAddress("accounts@example.com")
.enabled(true)
.build());
}
}
import pulumi
import pulumi_auth0 as auth0
# This is an example on how to set up the email provider with Amazon SES.
amazon_ses_email_provider = auth0.Email("amazonSesEmailProvider",
credentials=auth0.EmailCredentialsArgs(
access_key_id="AKIAXXXXXXXXXXXXXXXX",
region="us-east-1",
secret_access_key="7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
),
default_from_address="accounts@example.com",
enabled=True)
# This is an example on how to set up the email provider with SMTP.
smtp_email_provider = auth0.Email("smtpEmailProvider",
credentials=auth0.EmailCredentialsArgs(
smtp_host="your.smtp.host.com",
smtp_pass="SMTP Password",
smtp_port=583,
smtp_user="SMTP Username",
),
default_from_address="accounts@example.com",
enabled=True)
# This is an example on how to set up the email provider with Sendgrid.
sendgrid_email_provider = auth0.Email("sendgridEmailProvider",
credentials=auth0.EmailCredentialsArgs(
api_key="secretAPIKey",
),
default_from_address="accounts@example.com",
enabled=True)
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.Email("amazonSesEmailProvider", {
credentials: {
accessKeyId: "AKIAXXXXXXXXXXXXXXXX",
region: "us-east-1",
secretAccessKey: "7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
defaultFromAddress: "accounts@example.com",
enabled: true,
});
// This is an example on how to set up the email provider with SMTP.
const smtpEmailProvider = new auth0.Email("smtpEmailProvider", {
credentials: {
smtpHost: "your.smtp.host.com",
smtpPass: "SMTP Password",
smtpPort: 583,
smtpUser: "SMTP Username",
},
defaultFromAddress: "accounts@example.com",
enabled: true,
});
// This is an example on how to set up the email provider with Sendgrid.
const sendgridEmailProvider = new auth0.Email("sendgridEmailProvider", {
credentials: {
apiKey: "secretAPIKey",
},
defaultFromAddress: "accounts@example.com",
enabled: true,
});
resources:
# This is an example on how to set up the email provider with Amazon SES.
amazonSesEmailProvider:
type: auth0:Email
properties:
credentials:
accessKeyId: AKIAXXXXXXXXXXXXXXXX
region: us-east-1
secretAccessKey: 7e8c2148xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
defaultFromAddress: accounts@example.com
enabled: true
# This is an example on how to set up the email provider with SMTP.
smtpEmailProvider:
type: auth0:Email
properties:
credentials:
smtpHost: your.smtp.host.com
smtpPass: SMTP Password
smtpPort: 583
smtpUser: SMTP Username
defaultFromAddress: accounts@example.com
enabled: true
# This is an example on how to set up the email provider with Sendgrid.
sendgridEmailProvider:
type: auth0:Email
properties:
credentials:
apiKey: secretAPIKey
defaultFromAddress: accounts@example.com
enabled: true
Create Email Resource
new Email(name: string, args: EmailArgs, opts?: CustomResourceOptions);
@overload
def Email(resource_name: str,
opts: Optional[ResourceOptions] = None,
credentials: Optional[EmailCredentialsArgs] = None,
default_from_address: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
settings: Optional[EmailSettingsArgs] = None)
@overload
def Email(resource_name: str,
args: EmailArgs,
opts: Optional[ResourceOptions] = None)
func NewEmail(ctx *Context, name string, args EmailArgs, opts ...ResourceOption) (*Email, error)
public Email(string name, EmailArgs args, CustomResourceOptions? opts = null)
type: auth0:Email
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EmailArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EmailArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EmailArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EmailArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EmailArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Email Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Email resource accepts the following input properties:
- Credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- Default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- Enabled bool
Indicates whether the email provider is enabled.
- Name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- Settings
Email
Settings Specific email provider settings.
- Credentials
Email
Credentials Args Configuration settings for the credentials for the email provider.
- Default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- Enabled bool
Indicates whether the email provider is enabled.
- Name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- Settings
Email
Settings Args Specific email provider settings.
- credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- default
From StringAddress Email address to use as the sender when no other "from" address is specified.
- enabled Boolean
Indicates whether the email provider is enabled.
- name String
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Specific email provider settings.
- credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- enabled boolean
Indicates whether the email provider is enabled.
- name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Specific email provider settings.
- credentials
Email
Credentials Args Configuration settings for the credentials for the email provider.
- default_
from_ straddress Email address to use as the sender when no other "from" address is specified.
- enabled bool
Indicates whether the email provider is enabled.
- name str
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Args Specific email provider settings.
- credentials Property Map
Configuration settings for the credentials for the email provider.
- default
From StringAddress Email address to use as the sender when no other "from" address is specified.
- enabled Boolean
Indicates whether the email provider is enabled.
- name String
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings Property Map
Specific email provider settings.
Outputs
All input properties are implicitly available as output properties. Additionally, the Email resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing Email Resource
Get an existing Email resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EmailState, opts?: CustomResourceOptions): Email
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
credentials: Optional[EmailCredentialsArgs] = None,
default_from_address: Optional[str] = None,
enabled: Optional[bool] = None,
name: Optional[str] = None,
settings: Optional[EmailSettingsArgs] = None) -> Email
func GetEmail(ctx *Context, name string, id IDInput, state *EmailState, opts ...ResourceOption) (*Email, error)
public static Email Get(string name, Input<string> id, EmailState? state, CustomResourceOptions? opts = null)
public static Email get(String name, Output<String> id, EmailState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- Default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- Enabled bool
Indicates whether the email provider is enabled.
- Name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- Settings
Email
Settings Specific email provider settings.
- Credentials
Email
Credentials Args Configuration settings for the credentials for the email provider.
- Default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- Enabled bool
Indicates whether the email provider is enabled.
- Name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- Settings
Email
Settings Args Specific email provider settings.
- credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- default
From StringAddress Email address to use as the sender when no other "from" address is specified.
- enabled Boolean
Indicates whether the email provider is enabled.
- name String
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Specific email provider settings.
- credentials
Email
Credentials Configuration settings for the credentials for the email provider.
- default
From stringAddress Email address to use as the sender when no other "from" address is specified.
- enabled boolean
Indicates whether the email provider is enabled.
- name string
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Specific email provider settings.
- credentials
Email
Credentials Args Configuration settings for the credentials for the email provider.
- default_
from_ straddress Email address to use as the sender when no other "from" address is specified.
- enabled bool
Indicates whether the email provider is enabled.
- name str
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings
Email
Settings Args Specific email provider settings.
- credentials Property Map
Configuration settings for the credentials for the email provider.
- default
From StringAddress Email address to use as the sender when no other "from" address is specified.
- enabled Boolean
Indicates whether the email provider is enabled.
- name String
Name of the email provider. Options include
mailgun
,mandrill
,sendgrid
,ses
,smtp
, andsparkpost
.- settings Property Map
Specific email provider settings.
Supporting Types
EmailCredentials, EmailCredentialsArgs
- Access
Key stringId AWS Access Key ID. Used only for AWS.
- Api
Key string API Key for your email service. Will always be encrypted in our database.
- Api
User string API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- Domain string
Domain name.
- Region string
Default region. Used only for AWS, Mailgun, and SparkPost.
- Secret
Access stringKey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- Smtp
Host string Hostname or IP address of your SMTP server. Used only for SMTP.
- Smtp
Pass string SMTP password. Used only for SMTP.
- Smtp
Port int Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- Smtp
User string SMTP username. Used only for SMTP.
- Access
Key stringId AWS Access Key ID. Used only for AWS.
- Api
Key string API Key for your email service. Will always be encrypted in our database.
- Api
User string API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- Domain string
Domain name.
- Region string
Default region. Used only for AWS, Mailgun, and SparkPost.
- Secret
Access stringKey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- Smtp
Host string Hostname or IP address of your SMTP server. Used only for SMTP.
- Smtp
Pass string SMTP password. Used only for SMTP.
- Smtp
Port int Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- Smtp
User string SMTP username. Used only for SMTP.
- access
Key StringId AWS Access Key ID. Used only for AWS.
- api
Key String API Key for your email service. Will always be encrypted in our database.
- api
User String API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- domain String
Domain name.
- region String
Default region. Used only for AWS, Mailgun, and SparkPost.
- secret
Access StringKey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- smtp
Host String Hostname or IP address of your SMTP server. Used only for SMTP.
- smtp
Pass String SMTP password. Used only for SMTP.
- smtp
Port Integer Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- smtp
User String SMTP username. Used only for SMTP.
- access
Key stringId AWS Access Key ID. Used only for AWS.
- api
Key string API Key for your email service. Will always be encrypted in our database.
- api
User string API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- domain string
Domain name.
- region string
Default region. Used only for AWS, Mailgun, and SparkPost.
- secret
Access stringKey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- smtp
Host string Hostname or IP address of your SMTP server. Used only for SMTP.
- smtp
Pass string SMTP password. Used only for SMTP.
- smtp
Port number Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- smtp
User string SMTP username. Used only for SMTP.
- access_
key_ strid AWS Access Key ID. Used only for AWS.
- api_
key str API Key for your email service. Will always be encrypted in our database.
- api_
user str API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- domain str
Domain name.
- region str
Default region. Used only for AWS, Mailgun, and SparkPost.
- secret_
access_ strkey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- smtp_
host str Hostname or IP address of your SMTP server. Used only for SMTP.
- smtp_
pass str SMTP password. Used only for SMTP.
- smtp_
port int Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- smtp_
user str SMTP username. Used only for SMTP.
- access
Key StringId AWS Access Key ID. Used only for AWS.
- api
Key String API Key for your email service. Will always be encrypted in our database.
- api
User String API User for your email service. This field is not accepted by the API any more so it will be removed in a future major version.
This field is not accepted by the API any more so it will be removed soon.
- domain String
Domain name.
- region String
Default region. Used only for AWS, Mailgun, and SparkPost.
- secret
Access StringKey AWS Secret Key. Will always be encrypted in our database. Used only for AWS.
- smtp
Host String Hostname or IP address of your SMTP server. Used only for SMTP.
- smtp
Pass String SMTP password. Used only for SMTP.
- smtp
Port Number Port used by your SMTP server. Please avoid using port 25 if possible because many providers have limitations on this port. Used only for SMTP.
- smtp
User String SMTP username. Used only for SMTP.
EmailSettings, EmailSettingsArgs
- Headers
Email
Settings Headers Headers settings for the
smtp
email provider.- Message
Email
Settings Message Message settings for the
mandrill
orses
email provider.
- Headers
Email
Settings Headers Headers settings for the
smtp
email provider.- Message
Email
Settings Message Message settings for the
mandrill
orses
email provider.
- headers
Email
Settings Headers Headers settings for the
smtp
email provider.- message
Email
Settings Message Message settings for the
mandrill
orses
email provider.
- headers
Email
Settings Headers Headers settings for the
smtp
email provider.- message
Email
Settings Message Message settings for the
mandrill
orses
email provider.
- headers
Email
Settings Headers Headers settings for the
smtp
email provider.- message
Email
Settings Message Message settings for the
mandrill
orses
email provider.
- headers Property Map
Headers settings for the
smtp
email provider.- message Property Map
Message settings for the
mandrill
orses
email provider.
EmailSettingsHeaders, EmailSettingsHeadersArgs
- XMc
View stringContent Link - XSes
Configuration stringSet
- XMc
View stringContent Link - XSes
Configuration stringSet
- x
Mc StringView Content Link - x
Ses StringConfiguration Set
- x
Mc stringView Content Link - x
Ses stringConfiguration Set
- x
Mc StringView Content Link - x
Ses StringConfiguration Set
EmailSettingsMessage, EmailSettingsMessageArgs
- Configuration
Set stringName - View
Content boolLink
- Configuration
Set stringName - View
Content boolLink
- configuration
Set StringName - view
Content BooleanLink
- configuration
Set stringName - view
Content booleanLink
- configuration
Set StringName - view
Content BooleanLink
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 # Example
$ pulumi import auth0:index/email:Email my_email_provider b4213dc2-2eed-42c3-9516-c6131a9ce0b0
Package Details
- Repository
- Auth0 pulumi/pulumi-auth0
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
auth0
Terraform Provider.