]> git.immae.eu Git - github/fretlink/terraform-provider-mailgun.git/blob - website/docs/r/domain.html.markdown
add doc
[github/fretlink/terraform-provider-mailgun.git] / website / docs / r / domain.html.markdown
1 ---
2 layout: "mailgun"
3 page_title: "Mailgun: mailgun_domain"
4 sidebar_current: "docs-mailgun-domain"
5 description: |-
6 The domain_resource allows mailgun domain to be managed by Terraform.
7 ---
8
9 # mailgun\_domain
10
11 The domain resource allows Mailgun domain to be managed by Terraform.
12
13 ## Example Usage
14
15 ```hcl
16 resource "mailgun_domain" "example" {
17 name="domain.com"
18 spam_action="block"
19 smtp_password="password"
20 wildcard=true
21 force_dkim_authority=true
22 dkim_key_size=1024
23 ips=["192.161.0.1", "192.168.0.2"]
24 credentials{
25 login="login"
26 password="password"
27 }
28 open_tracking_settings_active=true
29 click_tracking_settings_active=true
30 unsubscribe_tracking_settings_active=true
31 unsubscribe_tracking_settings_html_footer="<p>footer</p>"
32 unsubscribe_tracking_settings_text_footer="footer"
33 require_tls=true
34 skip_verification=true
35 }
36 ```
37
38 ## Argument Reference
39
40 The following arguments are supported:
41
42 * `name` - (Required) Name of the domain
43 * `spam_action` - (Optional) "disabled", "block", or "tag".If "disabled", no spam filtering will occur for inbound messages.If "block", inbound spam messages will not be delivered.If "tag", inbound messages will be tagged with a spam header. See Spam Filter.Defaults to disabled.
44 * `smtp_password` - (Optional) Password for SMTP authentication
45 * `wildcard` - (Optional) Determines whether the domain will accept email for sub-domains when sending messages.Defaults to false.
46 * `force_dkim_authority` - (Optional) If set to true, the domain will be the DKIM authority for itself even if the root domain is registered on the same mailgun account.If set to false, the domain will have the same DKIM authority as the root domain registered on the same mailgun account. Defaults to false
47 * `dkim_key_size` - (Optional) 1024 or 2048. Set the length of your domain’s generated DKIM key. Defaults to 1024.
48 * `ips` - (Optional) An optional, comma-separated list of IP addresses to be assigned to this domain. If not specified, all dedicated IP addresses on the account will be assigned. If the request cannot be fulfilled (e.g. a requested IP is not assigned to the account, etc), a 400 will be returned.
49 * `credentials` - (Optional) SMTP credentials for the domain
50 * `open_tracking_settings_active` - (Optional) true to enable open tracking. Defauls to false
51 * `click_tracking_settings_active` - (Optional) true to enable click tracking. Defauls to false
52 * `unsubscribe_tracking_settings_active` - (Optional) true to enable unsubscribe tracking. Defauls to false
53 * `unsubscribe_tracking_settings_html_footer` - (Optional)Custom HTML version of unsubscribe footer.Defaults to "\n<br>\n<p><a hre=\"%unsubscribe_url%\">unsubscribe</a></p>\n"
54 * `unsubscribe_tracking_settings_text_footer` - (Optional) Custom text version of unsubscribe footer. Defaults to "\n\nTo unsubscribe click: <%unsubscribe_url%>\n\n"
55 * `require_tls` - (Optional) If set to true, this requires the message only be sent over a TLS connection. If a TLS connection can not be established, Mailgun will not deliver the message.If set to false, Mailgun will still try and upgrade the connection, but if Mailgun cannot, the message will be delivered over a plaintext SMTP connection. Defaults to false.
56 * `skip_verification` - (Optional)If set to true, the certificate and hostname will not be verified when trying to establish a TLS connection and Mailgun will accept any certificate during delivery. If set to false, Mailgun will verify the certificate and hostname. If either one can not be verified, a TLS connection will not be established. Defaults to false.
57 The `credentials` object supports the following:
58 * `login` - (Required) The user name
59 * `password` - (Required) A password for the SMTP credentials. (Length Min 5, Max 32)
60
61 ## Attributes Reference
62
63 The following attribute is exported:
64
65 * `smtp_login` - An username for the SMTP credentials.
66 * `created_at` - The date of creation of the domain.
67 * `state` - The state of the domain.
68 * `receiving_records` - DNS records for receiving.
69 * `sending_records` - DNS records for sending.
70 The `receiving_records` `sending_records` and object exports the following:
71 * `name` - The name of the record.
72 * `priority` - The priority of the record lower value means a more important priority.
73 * `record_type` - The type of record.
74 * `valid` - Wether the record is valid or not.
75 * `value` - The value of the record.
76
77 ## Import
78
79 Mailgun domain can be imported using the domain name, e.g.
80
81 ```
82 tf import mailgun_domain.example domain.com
83
84 ```