mailgun.Domain
Provides a Mailgun App resource. This can be used to create and manage applications on Mailgun.
After DNS records are set, domain verification should be triggered manually using PUT /domains/<domain>/verify
Example Usage
using Pulumi;
using Mailgun = Pulumi.Mailgun;
class MyStack : Stack
{
public MyStack()
{
// Create a new Mailgun domain
var @default = new Mailgun.Domain("default", new Mailgun.DomainArgs
{
DkimKeySize = 1024,
Region = "us",
SmtpPassword = "supersecretpassword1234",
SpamAction = "disabled",
});
}
}
package main
import (
"github.com/pulumi/pulumi-mailgun/sdk/v3/go/mailgun"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mailgun.NewDomain(ctx, "default", &mailgun.DomainArgs{
DkimKeySize: pulumi.Int(1024),
Region: pulumi.String("us"),
SmtpPassword: pulumi.String("supersecretpassword1234"),
SpamAction: pulumi.String("disabled"),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_mailgun as mailgun
# Create a new Mailgun domain
default = mailgun.Domain("default",
dkim_key_size=1024,
region="us",
smtp_password="supersecretpassword1234",
spam_action="disabled")
import * as pulumi from "@pulumi/pulumi";
import * as mailgun from "@pulumi/mailgun";
// Create a new Mailgun domain
const defaultDomain = new mailgun.Domain("default", {
dkimKeySize: 1024,
region: "us",
smtpPassword: "supersecretpassword1234",
spamAction: "disabled",
});
Coming soon!
Create Domain Resource
new Domain(name: string, args?: DomainArgs, opts?: CustomResourceOptions);
@overload
def Domain(resource_name: str,
opts: Optional[ResourceOptions] = None,
dkim_key_size: Optional[int] = None,
dkim_selector: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
smtp_password: Optional[str] = None,
spam_action: Optional[str] = None,
wildcard: Optional[bool] = None)
@overload
def Domain(resource_name: str,
args: Optional[DomainArgs] = None,
opts: Optional[ResourceOptions] = None)
func NewDomain(ctx *Context, name string, args *DomainArgs, opts ...ResourceOption) (*Domain, error)
public Domain(string name, DomainArgs? args = null, CustomResourceOptions? opts = null)
public Domain(String name, DomainArgs args)
public Domain(String name, DomainArgs args, CustomResourceOptions options)
type: mailgun:Domain
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainArgs
- 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 DomainArgs
- 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 DomainArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DomainArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DomainArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Domain 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 Domain resource accepts the following input properties:
- Dkim
Key intSize The length of your domain’s generated DKIM key. Default value is
1024
.- Dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- Name string
The domain to add to Mailgun
- Region string
The region where domain will be created. Default value is
us
.- Smtp
Password string Password for SMTP authentication
- Spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- Wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- Dkim
Key intSize The length of your domain’s generated DKIM key. Default value is
1024
.- Dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- Name string
The domain to add to Mailgun
- Region string
The region where domain will be created. Default value is
us
.- Smtp
Password string Password for SMTP authentication
- Spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- Wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key IntegerSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector String The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name String
The domain to add to Mailgun
- region String
The region where domain will be created. Default value is
us
.- smtp
Password String Password for SMTP authentication
- spam
Action String disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard Boolean
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key numberSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name string
The domain to add to Mailgun
- region string
The region where domain will be created. Default value is
us
.- smtp
Password string Password for SMTP authentication
- spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard boolean
Boolean that determines whether the domain will accept email for sub-domains.
- dkim_
key_ intsize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim_
selector str The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name str
The domain to add to Mailgun
- region str
The region where domain will be created. Default value is
us
.- smtp_
password str Password for SMTP authentication
- spam_
action str disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key NumberSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector String The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name String
The domain to add to Mailgun
- region String
The region where domain will be created. Default value is
us
.- smtp
Password String Password for SMTP authentication
- spam
Action String disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard Boolean
Boolean that determines whether the domain will accept email for sub-domains.
Outputs
All input properties are implicitly available as output properties. Additionally, the Domain resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Receiving
Records List<DomainReceiving Record> A list of DNS records for receiving validation.
- Sending
Records List<DomainSending Record> A list of DNS records for sending validation.
- Smtp
Login string The login email for the SMTP server.
- Id string
The provider-assigned unique ID for this managed resource.
- Receiving
Records []DomainReceiving Record A list of DNS records for receiving validation.
- Sending
Records []DomainSending Record A list of DNS records for sending validation.
- Smtp
Login string The login email for the SMTP server.
- id String
The provider-assigned unique ID for this managed resource.
- receiving
Records List<DomainReceiving Record> A list of DNS records for receiving validation.
- sending
Records List<DomainSending Record> A list of DNS records for sending validation.
- smtp
Login String The login email for the SMTP server.
- id string
The provider-assigned unique ID for this managed resource.
- receiving
Records DomainReceiving Record[] A list of DNS records for receiving validation.
- sending
Records DomainSending Record[] A list of DNS records for sending validation.
- smtp
Login string The login email for the SMTP server.
- id str
The provider-assigned unique ID for this managed resource.
- receiving_
records Sequence[DomainReceiving Record] A list of DNS records for receiving validation.
- sending_
records Sequence[DomainSending Record] A list of DNS records for sending validation.
- smtp_
login str The login email for the SMTP server.
- id String
The provider-assigned unique ID for this managed resource.
- receiving
Records List<Property Map> A list of DNS records for receiving validation.
- sending
Records List<Property Map> A list of DNS records for sending validation.
- smtp
Login String The login email for the SMTP server.
Look up Existing Domain Resource
Get an existing Domain 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?: DomainState, opts?: CustomResourceOptions): Domain
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
dkim_key_size: Optional[int] = None,
dkim_selector: Optional[str] = None,
name: Optional[str] = None,
receiving_records: Optional[Sequence[DomainReceivingRecordArgs]] = None,
region: Optional[str] = None,
sending_records: Optional[Sequence[DomainSendingRecordArgs]] = None,
smtp_login: Optional[str] = None,
smtp_password: Optional[str] = None,
spam_action: Optional[str] = None,
wildcard: Optional[bool] = None) -> Domain
func GetDomain(ctx *Context, name string, id IDInput, state *DomainState, opts ...ResourceOption) (*Domain, error)
public static Domain Get(string name, Input<string> id, DomainState? state, CustomResourceOptions? opts = null)
public static Domain get(String name, Output<String> id, DomainState 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.
- Dkim
Key intSize The length of your domain’s generated DKIM key. Default value is
1024
.- Dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- Name string
The domain to add to Mailgun
- Receiving
Records List<DomainReceiving Record Args> A list of DNS records for receiving validation.
- Region string
The region where domain will be created. Default value is
us
.- Sending
Records List<DomainSending Record Args> A list of DNS records for sending validation.
- Smtp
Login string The login email for the SMTP server.
- Smtp
Password string Password for SMTP authentication
- Spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- Wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- Dkim
Key intSize The length of your domain’s generated DKIM key. Default value is
1024
.- Dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- Name string
The domain to add to Mailgun
- Receiving
Records []DomainReceiving Record Args A list of DNS records for receiving validation.
- Region string
The region where domain will be created. Default value is
us
.- Sending
Records []DomainSending Record Args A list of DNS records for sending validation.
- Smtp
Login string The login email for the SMTP server.
- Smtp
Password string Password for SMTP authentication
- Spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- Wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key IntegerSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector String The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name String
The domain to add to Mailgun
- receiving
Records List<DomainReceiving Record Args> A list of DNS records for receiving validation.
- region String
The region where domain will be created. Default value is
us
.- sending
Records List<DomainSending Record Args> A list of DNS records for sending validation.
- smtp
Login String The login email for the SMTP server.
- smtp
Password String Password for SMTP authentication
- spam
Action String disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard Boolean
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key numberSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector string The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name string
The domain to add to Mailgun
- receiving
Records DomainReceiving Record Args[] A list of DNS records for receiving validation.
- region string
The region where domain will be created. Default value is
us
.- sending
Records DomainSending Record Args[] A list of DNS records for sending validation.
- smtp
Login string The login email for the SMTP server.
- smtp
Password string Password for SMTP authentication
- spam
Action string disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard boolean
Boolean that determines whether the domain will accept email for sub-domains.
- dkim_
key_ intsize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim_
selector str The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name str
The domain to add to Mailgun
- receiving_
records Sequence[DomainReceiving Record Args] A list of DNS records for receiving validation.
- region str
The region where domain will be created. Default value is
us
.- sending_
records Sequence[DomainSending Record Args] A list of DNS records for sending validation.
- smtp_
login str The login email for the SMTP server.
- smtp_
password str Password for SMTP authentication
- spam_
action str disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard bool
Boolean that determines whether the domain will accept email for sub-domains.
- dkim
Key NumberSize The length of your domain’s generated DKIM key. Default value is
1024
.- dkim
Selector String The name of your DKIM selector if you want to specify it whereas MailGun will make it's own choice.
- name String
The domain to add to Mailgun
- receiving
Records List<Property Map> A list of DNS records for receiving validation.
- region String
The region where domain will be created. Default value is
us
.- sending
Records List<Property Map> A list of DNS records for sending validation.
- smtp
Login String The login email for the SMTP server.
- smtp
Password String Password for SMTP authentication
- spam
Action String disabled
ortag
Disable, no spam filtering will occur for inbound messages. Tag, messages will be tagged with a spam header.- wildcard Boolean
Boolean that determines whether the domain will accept email for sub-domains.
Supporting Types
DomainReceivingRecord
- Priority string
The priority of the record.
- Record
Type string The record type.
- Valid string
"valid"
if the record is valid.- Value string
The value of the record.
- Priority string
The priority of the record.
- Record
Type string The record type.
- Valid string
"valid"
if the record is valid.- Value string
The value of the record.
- priority String
The priority of the record.
- record
Type String The record type.
- valid String
"valid"
if the record is valid.- value String
The value of the record.
- priority string
The priority of the record.
- record
Type string The record type.
- valid string
"valid"
if the record is valid.- value string
The value of the record.
- priority str
The priority of the record.
- record_
type str The record type.
- valid str
"valid"
if the record is valid.- value str
The value of the record.
- priority String
The priority of the record.
- record
Type String The record type.
- valid String
"valid"
if the record is valid.- value String
The value of the record.
DomainSendingRecord
- Name string
The domain to add to Mailgun
- Record
Type string The record type.
- Valid string
"valid"
if the record is valid.- Value string
The value of the record.
- Name string
The domain to add to Mailgun
- Record
Type string The record type.
- Valid string
"valid"
if the record is valid.- Value string
The value of the record.
- name String
The domain to add to Mailgun
- record
Type String The record type.
- valid String
"valid"
if the record is valid.- value String
The value of the record.
- name string
The domain to add to Mailgun
- record
Type string The record type.
- valid string
"valid"
if the record is valid.- value string
The value of the record.
- name str
The domain to add to Mailgun
- record_
type str The record type.
- valid str
"valid"
if the record is valid.- value str
The value of the record.
- name String
The domain to add to Mailgun
- record
Type String The record type.
- valid String
"valid"
if the record is valid.- value String
The value of the record.
Import
Domains can be imported using region:domain_name
via import
command. Region has to be chosen from eu
or us
(when no selection us
is applied).
hcl
$ pulumi import mailgun:index/domain:Domain test us:example.domain.com
Package Details
- Repository
- Mailgun pulumi/pulumi-mailgun
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
mailgun
Terraform Provider.