Viewing docs for Mailgun v3.9.0
published on Wednesday, Jul 15, 2026 by Pulumi
published on Wednesday, Jul 15, 2026 by Pulumi
Viewing docs for Mailgun v3.9.0
published on Wednesday, Jul 15, 2026 by Pulumi
published on Wednesday, Jul 15, 2026 by Pulumi
mailgun.Domain provides details about a Mailgun domain.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as mailgun from "@pulumi/mailgun";
const domain = mailgun.getDomain({
name: "test.example.com",
});
const mailgun_mx = new aws.index.Route53Record("mailgun-mx", {
zoneId: zoneId,
name: domainMailgun.name,
type: "MX",
ttl: 3600,
records: [
`${domain.receivingRecords?.[0]?.priority} ${domain.receivingRecords?.[0]?.value}.`,
`${domain.receivingRecords?.[1]?.priority} ${domain.receivingRecords?.[1]?.value}.`,
],
});
import pulumi
import pulumi_aws as aws
import pulumi_mailgun as mailgun
domain = mailgun.get_domain(name="test.example.com")
mailgun_mx = aws.Route53Record("mailgun-mx",
zone_id=zone_id,
name=domain_mailgun.name,
type=MX,
ttl=3600,
records=[
f{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.,
f{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.,
])
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
"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 {
domain, err := mailgun.GetDomain(ctx, &mailgun.LookupDomainArgs{
Name: "test.example.com",
}, nil)
if err != nil {
return err
}
_, err = aws.NewRoute53Record(ctx, "mailgun-mx", &aws.Route53RecordArgs{
ZoneId: zoneId,
Name: domainMailgun.Name,
Type: "MX",
Ttl: 3600,
Records: []string{
fmt.Sprintf("%v %v.", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value),
fmt.Sprintf("%v %v.", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Mailgun = Pulumi.Mailgun;
return await Deployment.RunAsync(() =>
{
var domain = Mailgun.GetDomain.Invoke(new()
{
Name = "test.example.com",
});
var mailgun_mx = new Aws.Route53Record("mailgun-mx", new()
{
ZoneId = zoneId,
Name = domainMailgun.Name,
Type = "MX",
Ttl = 3600,
Records = new[]
{
$"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Value)}.",
$"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Value)}.",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mailgun.MailgunFunctions;
import com.pulumi.mailgun.inputs.GetDomainArgs;
import com.pulumi.aws.Route53Record;
import com.pulumi.aws.Route53RecordArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var domain = MailgunFunctions.getDomain(GetDomainArgs.builder()
.name("test.example.com")
.build());
var mailgun_mx = new Route53Record("mailgun-mx", Route53RecordArgs.builder()
.zoneId(zoneId)
.name(domainMailgun.name())
.type("MX")
.ttl(3600)
.records(Arrays.asList(
String.format("%s %s.", domain.receivingRecords()[0].priority(),domain.receivingRecords()[0].value()),
String.format("%s %s.", domain.receivingRecords()[1].priority(),domain.receivingRecords()[1].value())))
.build());
}
}
resources:
mailgun-mx:
type: aws:Route53Record
properties:
zoneId: ${zoneId}
name: ${domainMailgun.name}
type: MX
ttl: 3600
records:
- ${domain.receivingRecords[0].priority} ${domain.receivingRecords[0].value}.
- ${domain.receivingRecords[1].priority} ${domain.receivingRecords[1].value}.
variables:
domain:
fn::invoke:
function: mailgun:getDomain
arguments:
name: test.example.com
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
mailgun = {
source = "pulumi/mailgun"
}
}
}
data "mailgun_getdomain" "domain" {
name = "test.example.com"
}
resource "aws_route53record" "mailgun-mx" {
zone_id = zoneId
name = domainMailgun.name
type = "MX"
ttl = 3600
records = ["${data.mailgun_getdomain.domain.receivingRecords[0].priority} ${data.mailgun_getdomain.domain.receivingRecords[0].value}.", "${data.mailgun_getdomain.domain.receivingRecords[1].priority} ${data.mailgun_getdomain.domain.receivingRecords[1].value}."]
}
Using getDomain
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDomain(args: GetDomainArgs, opts?: InvokeOptions): Promise<GetDomainResult>
function getDomainOutput(args: GetDomainOutputArgs, opts?: InvokeOutputOptions): Output<GetDomainResult>def get_domain(name: Optional[str] = None,
region: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDomainResult
def get_domain_output(name: pulumi.Input[Optional[str]] = None,
region: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetDomainResult]func LookupDomain(ctx *Context, args *LookupDomainArgs, opts ...InvokeOption) (*LookupDomainResult, error)
func LookupDomainOutput(ctx *Context, args *LookupDomainOutputArgs, opts ...InvokeOption) LookupDomainResultOutput> Note: This function is named LookupDomain in the Go SDK.
public static class GetDomain
{
public static Task<GetDomainResult> InvokeAsync(GetDomainArgs args, InvokeOptions? opts = null)
public static Output<GetDomainResult> Invoke(GetDomainInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetDomainResult> Invoke(GetDomainInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetDomainResult> getDomain(GetDomainArgs args, InvokeOptions options)
public static Output<GetDomainResult> getDomain(GetDomainArgs args, InvokeOptions options)
public static Output<GetDomainResult> getDomain(GetDomainArgs args, InvokeOutputOptions options)
fn::invoke:
function: mailgun:index/getDomain:getDomain
arguments:
# arguments dictionarydata "mailgun_get_domain" "name" {
# arguments
}The following arguments are supported:
getDomain Result
The following output properties are available:
- Click
Tracking bool - The click tracking setting.
- Dkim
Key intSize - Dkim
Selector string - bool
- Id string
- Name string
- The name of the record.
- Open
Tracking bool - The open tracking setting.
- Receiving
Records List<GetSets Domain Receiving Records Set> - Region string
- Sending
Records List<GetSets Domain Sending Records Set> - Smtp
Login string - The login email for the SMTP server.
- Smtp
Password string - The password to the SMTP server.
- Spam
Action string - The spam filtering setting.
- Use
Automatic boolSender Security - Web
Scheme string - The tracking web scheme.
- Wildcard bool
- Whether or not the domain will accept email for sub-domains.
- Click
Tracking bool - The click tracking setting.
- Dkim
Key intSize - Dkim
Selector string - bool
- Id string
- Name string
- The name of the record.
- Open
Tracking bool - The open tracking setting.
- Receiving
Records []GetSets Domain Receiving Records Set - Region string
- Sending
Records []GetSets Domain Sending Records Set - Smtp
Login string - The login email for the SMTP server.
- Smtp
Password string - The password to the SMTP server.
- Spam
Action string - The spam filtering setting.
- Use
Automatic boolSender Security - Web
Scheme string - The tracking web scheme.
- Wildcard bool
- Whether or not the domain will accept email for sub-domains.
- click_
tracking bool - The click tracking setting.
- dkim_
key_ numbersize - dkim_
selector string - bool
- id string
- name string
- The name of the record.
- open_
tracking bool - The open tracking setting.
- receiving_
records_ list(object)sets - region string
- sending_
records_ list(object)sets - smtp_
login string - The login email for the SMTP server.
- smtp_
password string - The password to the SMTP server.
- spam_
action string - The spam filtering setting.
- use_
automatic_ boolsender_ security - web_
scheme string - The tracking web scheme.
- wildcard bool
- Whether or not the domain will accept email for sub-domains.
- click
Tracking Boolean - The click tracking setting.
- dkim
Key IntegerSize - dkim
Selector String - Boolean
- id String
- name String
- The name of the record.
- open
Tracking Boolean - The open tracking setting.
- receiving
Records List<GetSets Domain Receiving Records Set> - region String
- sending
Records List<GetSets Domain Sending Records Set> - smtp
Login String - The login email for the SMTP server.
- smtp
Password String - The password to the SMTP server.
- spam
Action String - The spam filtering setting.
- use
Automatic BooleanSender Security - web
Scheme String - The tracking web scheme.
- wildcard Boolean
- Whether or not the domain will accept email for sub-domains.
- click
Tracking boolean - The click tracking setting.
- dkim
Key numberSize - dkim
Selector string - boolean
- id string
- name string
- The name of the record.
- open
Tracking boolean - The open tracking setting.
- receiving
Records GetSets Domain Receiving Records Set[] - region string
- sending
Records GetSets Domain Sending Records Set[] - smtp
Login string - The login email for the SMTP server.
- smtp
Password string - The password to the SMTP server.
- spam
Action string - The spam filtering setting.
- use
Automatic booleanSender Security - web
Scheme string - The tracking web scheme.
- wildcard boolean
- Whether or not the domain will accept email for sub-domains.
- click_
tracking bool - The click tracking setting.
- dkim_
key_ intsize - dkim_
selector str - bool
- id str
- name str
- The name of the record.
- open_
tracking bool - The open tracking setting.
- receiving_
records_ Sequence[Getsets Domain Receiving Records Set] - region str
- sending_
records_ Sequence[Getsets Domain Sending Records Set] - smtp_
login str - The login email for the SMTP server.
- smtp_
password str - The password to the SMTP server.
- spam_
action str - The spam filtering setting.
- use_
automatic_ boolsender_ security - web_
scheme str - The tracking web scheme.
- wildcard bool
- Whether or not the domain will accept email for sub-domains.
- click
Tracking Boolean - The click tracking setting.
- dkim
Key NumberSize - dkim
Selector String - Boolean
- id String
- name String
- The name of the record.
- open
Tracking Boolean - The open tracking setting.
- receiving
Records List<Property Map>Sets - region String
- sending
Records List<Property Map>Sets - smtp
Login String - The login email for the SMTP server.
- smtp
Password String - The password to the SMTP server.
- spam
Action String - The spam filtering setting.
- use
Automatic BooleanSender Security - web
Scheme String - The tracking web scheme.
- wildcard Boolean
- Whether or not the domain will accept email for sub-domains.
Supporting Types
GetDomainReceivingRecordsSet
- Id string
- 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.
- Id string
- 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.
- id string
- 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.
- id String
- 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.
- id string
- 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.
- id str
- 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.
- id String
- 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.
GetDomainSendingRecordsSet
- Id string
- Name string
- The name of the domain.
- Record
Type string - The record type.
- Valid string
"valid"if the record is valid.- Value string
- The value of the record.
- Id string
- Name string
- The name of the domain.
- Record
Type string - The record type.
- Valid string
"valid"if the record is valid.- Value string
- The value of the record.
- id string
- name string
- The name of the domain.
- record_
type string - The record type.
- valid string
"valid"if the record is valid.- value string
- The value of the record.
- id String
- name String
- The name of the domain.
- record
Type String - The record type.
- valid String
"valid"if the record is valid.- value String
- The value of the record.
- id string
- name string
- The name of the domain.
- record
Type string - The record type.
- valid string
"valid"if the record is valid.- value string
- The value of the record.
- id str
- name str
- The name of the domain.
- record_
type str - The record type.
- valid str
"valid"if the record is valid.- value str
- The value of the record.
- id String
- name String
- The name of the domain.
- record
Type String - The record type.
- valid String
"valid"if the record is valid.- value String
- The value of the record.
Package Details
- Repository
- Mailgun pulumi/pulumi-mailgun
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mailgunTerraform Provider.
Viewing docs for Mailgun v3.9.0
published on Wednesday, Jul 15, 2026 by Pulumi
published on Wednesday, Jul 15, 2026 by Pulumi