]>
Commit | Line | Data |
---|---|---|
1 | --- | |
2 | layout: "mailgun" | |
3 | page_title: "Mailgun: mailgun_route" | |
4 | sidebar_current: "docs-mailgun-route" | |
5 | description: |- | |
6 | The route_resource allows mailgun route to be managed by Terraform. | |
7 | --- | |
8 | ||
9 | # mailgun\_route | |
10 | ||
11 | The route resource allows Mailgun route to be managed by Terraform. | |
12 | ||
13 | ## Example Usage | |
14 | ||
15 | ```hcl | |
16 | resource "mailgun_route" "example" { | |
17 | priority=5 | |
18 | description="description" | |
19 | expression="match_recipient(\".*@samples.mailgun.org\")" | |
20 | actions=[ | |
21 | "forward(\"http://myhost.com/messages/\")", | |
22 | "stop()" | |
23 | ] | |
24 | } | |
25 | ``` | |
26 | ||
27 | ## Argument Reference | |
28 | ||
29 | The following arguments are supported: | |
30 | ||
31 | * `priority` - (Required)Integer: smaller number indicates higher priority. Higher priority routes are handled first. | |
32 | * `expression` - (Required) An arbitrary string. | |
33 | * `description` - (Required) A filter expression like match_recipient('.*@gmail.com') | |
34 | * `actions` - (Required) Route action. This action is executed when the expression evaluates to True. Example: forward("alice@example.com") You can pass multiple action parameters. | |
35 | ||
36 | ||
37 | ## Attributes Reference | |
38 | ||
39 | The following attribute is exported: | |
40 | ||
41 | * `route_id` - ID of the route. | |
42 | * `created_at` - The date of creation of the route. | |
43 | ||
44 | ## Import | |
45 | ||
46 | Mailgun can be imported using the route ID, e.g. | |
47 | ||
48 | ``` | |
49 | tf import mailgun_route.example 4f3bad2335335426750048c6 | |
50 | ||
51 | ``` |