Route
Provides a Mailgun Route resource. This can be used to create and manage routes on Mailgun.
Example Usage
using Pulumi;
using Mailgun = Pulumi.Mailgun;
class MyStack : Stack
{
public MyStack()
{
// Create a new Mailgun route
var @default = new Mailgun.Route("default", new Mailgun.RouteArgs
{
Actions =
{
"forward('http://example.com/api/v1/foos/')",
"stop()",
},
Description = "inbound",
Expression = "match_recipient('.*@foo.example.com')",
Priority = 0,
});
}
}
package main
import (
"github.com/pulumi/pulumi-mailgun/sdk/v2/go/mailgun"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mailgun.NewRoute(ctx, "_default", &mailgun.RouteArgs{
Actions: pulumi.StringArray{
pulumi.String("forward('http://example.com/api/v1/foos/')"),
pulumi.String("stop()"),
},
Description: pulumi.String("inbound"),
Expression: pulumi.String("match_recipient('.*@foo.example.com')"),
Priority: pulumi.Int(0),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_mailgun as mailgun
# Create a new Mailgun route
default = mailgun.Route("default",
actions=[
"forward('http://example.com/api/v1/foos/')",
"stop()",
],
description="inbound",
expression="match_recipient('.*@foo.example.com')",
priority=0)
import * as pulumi from "@pulumi/pulumi";
import * as mailgun from "@pulumi/mailgun";
// Create a new Mailgun route
const defaultRoute = new mailgun.Route("default", {
actions: [
"forward('http://example.com/api/v1/foos/')",
"stop()",
],
description: "inbound",
expression: "match_recipient('.*@foo.example.com')",
priority: 0,
});
Create a Route Resource
new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
def Route(resource_name: str, opts: Optional[ResourceOptions] = None, actions: Optional[Sequence[str]] = None, description: Optional[str] = None, expression: Optional[str] = None, priority: Optional[int] = None, region: Optional[str] = None)
func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Route Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Route resource accepts the following input properties:
- Actions List<string>
- Expression string
A filter expression like
match_recipient('.*@gmail.com')
- Priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- Description string
- Region string
The region where domain will be created. Default value is
us
.
- Actions []string
- Expression string
A filter expression like
match_recipient('.*@gmail.com')
- Priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- Description string
- Region string
The region where domain will be created. Default value is
us
.
- actions string[]
- expression string
A filter expression like
match_recipient('.*@gmail.com')
- priority number
Smaller number indicates higher priority. Higher priority routes are handled first.
- description string
- region string
The region where domain will be created. Default value is
us
.
- actions Sequence[str]
- expression str
A filter expression like
match_recipient('.*@gmail.com')
- priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- description str
- region str
The region where domain will be created. Default value is
us
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Route 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 str
- The provider-assigned unique ID for this managed resource.
Look up an Existing Route Resource
Get an existing Route 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?: RouteState, opts?: CustomResourceOptions): Route
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, actions: Optional[Sequence[str]] = None, description: Optional[str] = None, expression: Optional[str] = None, priority: Optional[int] = None, region: Optional[str] = None) -> Route
func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)
public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)
- 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.
The following state arguments are supported:
- Actions List<string>
- Description string
- Expression string
A filter expression like
match_recipient('.*@gmail.com')
- Priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- Region string
The region where domain will be created. Default value is
us
.
- Actions []string
- Description string
- Expression string
A filter expression like
match_recipient('.*@gmail.com')
- Priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- Region string
The region where domain will be created. Default value is
us
.
- actions string[]
- description string
- expression string
A filter expression like
match_recipient('.*@gmail.com')
- priority number
Smaller number indicates higher priority. Higher priority routes are handled first.
- region string
The region where domain will be created. Default value is
us
.
- actions Sequence[str]
- description str
- expression str
A filter expression like
match_recipient('.*@gmail.com')
- priority int
Smaller number indicates higher priority. Higher priority routes are handled first.
- region str
The region where domain will be created. Default value is
us
.
Import
Routes can be imported using ROUTE_ID
and region
via import
command. Route ID can be found on Mailgun portal in section Receiving/Routes
. Region has to be chosen from eu
or us
(when no selection us
is applied).
hcl
$ pulumi import mailgun:index/route:Route test eu:123456789
Package Details
- Repository
- https://github.com/pulumi/pulumi-mailgun
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mailgun
Terraform Provider.