3 page_title: "Provider: Mailgun"
4 sidebar_current: "docs-mailgun-index"
6 The Mailgun provider configures domains and routes in Mailgun.
11 The Mailgun provider allows Terraform to create and configure domains and routes in [Mailgun](https://www.mailgun.com/).
13 The provider configuration block accepts the following arguments:
15 * ``domain`` - (Required) The domain name for the ressources created with the provider. May alternatively be set via the
16 ``MAILGUN_DOMAIN`` environment variable.
18 * ``apikey`` - (Required) The API auth token to use when making requests. May alternatively
19 be set via the ``MAILGUN_APIKEY`` environment variable.
21 Use the navigation to the left to read about the available resources.
28 apikey = "15ee99178cc7q6325df7ff8a15211228-2f778ta3-e04c2946"
31 resource "mailgun_domain" "example" {
34 smtp_password="password"
36 force_dkim_authority=true
38 ips=["192.161.0.1", "192.168.0.2"]
43 open_tracking_settings_active=true
44 click_tracking_settings_active=true
45 unsubscribe_tracking_settings_active=true
46 unsubscribe_tracking_settings_html_footer="<p>footer</p>"
47 unsubscribe_tracking_settings_text_footer="footer"
49 skip_verification=true
52 resource "mailgun_route" "example" {
53 depends_on = [mailgun_domain.example]
55 description="description"
56 expression="match_recipient(\".*@samples.mailgun.org\")"
58 "forward(\"http://myhost.com/messages/\")",