mailgun.getDomain
Explore with Pulumi AI
mailgun.Domain
provides details about a Mailgun domain.
Example Usage
using System.Collections.Generic;
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.Route53.Record("mailgun-mx", new()
{
Name = data.Mailgun.Domain.Name,
Records = new[]
{
Output.Tuple(domain.Apply(getDomainResult => getDomainResult), domain.Apply(getDomainResult => getDomainResult)).Apply(values =>
{
var domain = values.Item1;
var domain1 = values.Item2;
return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[0]?.Priority)} {domain1.ReceivingRecords[0]?.Value}.";
}),
Output.Tuple(domain.Apply(getDomainResult => getDomainResult), domain.Apply(getDomainResult => getDomainResult)).Apply(values =>
{
var domain = values.Item1;
var domain1 = values.Item2;
return $"{domain.Apply(getDomainResult => getDomainResult.ReceivingRecords[1]?.Priority)} {domain1.ReceivingRecords[1]?.Value}.";
}),
},
Ttl = 3600,
Type = "MX",
ZoneId = @var.Zone_id,
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53"
"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.LookupDomain(ctx, &mailgun.LookupDomainArgs{
Name: "test.example.com",
}, nil)
if err != nil {
return err
}
_, err = route53.NewRecord(ctx, "mailgun-mx", &route53.RecordArgs{
Name: pulumi.Any(data.Mailgun.Domain.Name),
Records: pulumi.StringArray{
pulumi.String(fmt.Sprintf("%v %v.", domain.ReceivingRecords[0].Priority, domain.ReceivingRecords[0].Value)),
pulumi.String(fmt.Sprintf("%v %v.", domain.ReceivingRecords[1].Priority, domain.ReceivingRecords[1].Value)),
},
Ttl: pulumi.Int(3600),
Type: pulumi.String("MX"),
ZoneId: pulumi.Any(_var.Zone_id),
})
if err != nil {
return err
}
return nil
})
}
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.route53.Record;
import com.pulumi.aws.route53.RecordArgs;
import java.util.List;
import java.util.ArrayList;
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 Record("mailgun-mx", RecordArgs.builder()
.name(data.mailgun().domain().name())
.records(
String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[0].value())),
String.format("%s %s.", domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].priority()),domain.applyValue(getDomainResult -> getDomainResult.receivingRecords()[1].value())))
.ttl(3600)
.type("MX")
.zoneId(var_.zone_id())
.build());
}
}
import pulumi
import pulumi_aws as aws
import pulumi_mailgun as mailgun
domain = mailgun.get_domain(name="test.example.com")
mailgun_mx = aws.route53.Record("mailgun-mx",
name=data["mailgun"]["domain"]["name"],
records=[
f"{domain.receiving_records[0].priority} {domain.receiving_records[0].value}.",
f"{domain.receiving_records[1].priority} {domain.receiving_records[1].value}.",
],
ttl=3600,
type="MX",
zone_id=var["zone_id"])
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.route53.Record("mailgun-mx", {
name: data.mailgun.domain.name,
records: [
Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[0]?.priority} ${domain1.receivingRecords?.[0]?.value}.`),
Promise.all([domain, domain]).then(([domain, domain1]) => `${domain.receivingRecords?.[1]?.priority} ${domain1.receivingRecords?.[1]?.value}.`),
],
ttl: 3600,
type: "MX",
zoneId: _var.zone_id,
});
resources:
mailgun-mx:
type: aws:route53:Record
properties:
name: ${data.mailgun.domain.name}
records:
- ${domain.receivingRecords[0].priority} ${domain.receivingRecords[0].value}.
- ${domain.receivingRecords[1].priority} ${domain.receivingRecords[1].value}.
ttl: 3600
type: MX
zoneId: ${var.zone_id}
variables:
domain:
fn::invoke:
Function: mailgun:getDomain
Arguments:
name: test.example.com
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?: InvokeOptions): Output<GetDomainResult>
def get_domain(dkim_key_size: Optional[int] = None,
dkim_selector: Optional[str] = None,
force_dkim_authority: Optional[bool] = None,
name: Optional[str] = None,
open_tracking: Optional[bool] = None,
region: Optional[str] = None,
smtp_password: Optional[str] = None,
spam_action: Optional[str] = None,
wildcard: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetDomainResult
def get_domain_output(dkim_key_size: Optional[pulumi.Input[int]] = None,
dkim_selector: Optional[pulumi.Input[str]] = None,
force_dkim_authority: Optional[pulumi.Input[bool]] = None,
name: Optional[pulumi.Input[str]] = None,
open_tracking: Optional[pulumi.Input[bool]] = None,
region: Optional[pulumi.Input[str]] = None,
smtp_password: Optional[pulumi.Input[str]] = None,
spam_action: Optional[pulumi.Input[str]] = None,
wildcard: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = 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 CompletableFuture<GetDomainResult> getDomain(GetDomainArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: mailgun:index/getDomain:getDomain
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
The name of the domain.
- Dkim
Key intSize - Dkim
Selector string - bool
- Open
Tracking bool - Region string
The region where domain will be created. Default value is
us
.- Smtp
Password string The password to the SMTP server.
- Spam
Action string The spam filtering setting.
- Wildcard bool
Whether or not the domain will accept email for sub-domains.
- Name string
The name of the domain.
- Dkim
Key intSize - Dkim
Selector string - bool
- Open
Tracking bool - Region string
The region where domain will be created. Default value is
us
.- Smtp
Password string The password to the SMTP server.
- Spam
Action string The spam filtering setting.
- Wildcard bool
Whether or not the domain will accept email for sub-domains.
- name String
The name of the domain.
- dkim
Key IntegerSize - dkim
Selector String - Boolean
- open
Tracking Boolean - region String
The region where domain will be created. Default value is
us
.- smtp
Password String The password to the SMTP server.
- spam
Action String The spam filtering setting.
- wildcard Boolean
Whether or not the domain will accept email for sub-domains.
- name string
The name of the domain.
- dkim
Key numberSize - dkim
Selector string - boolean
- open
Tracking boolean - region string
The region where domain will be created. Default value is
us
.- smtp
Password string The password to the SMTP server.
- spam
Action string The spam filtering setting.
- wildcard boolean
Whether or not the domain will accept email for sub-domains.
- name str
The name of the domain.
- dkim_
key_ intsize - dkim_
selector str - bool
- open_
tracking bool - region str
The region where domain will be created. Default value is
us
.- smtp_
password str The password to the SMTP server.
- spam_
action str The spam filtering setting.
- wildcard bool
Whether or not the domain will accept email for sub-domains.
- name String
The name of the domain.
- dkim
Key NumberSize - dkim
Selector String - Boolean
- open
Tracking Boolean - region String
The region where domain will be created. Default value is
us
.- smtp
Password String The password to the SMTP server.
- spam
Action String The spam filtering setting.
- wildcard Boolean
Whether or not the domain will accept email for sub-domains.
getDomain Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The name of the record.
- Receiving
Records List<GetDomain Receiving Record> A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- Receiving
Records List<GetSets Domain Receiving Records Set> - Sending
Records List<GetDomain Sending Record> A list of DNS records for sending validation.
Use
sending_records_set
instead.- Sending
Records List<GetSets Domain Sending Records Set> - Smtp
Login string The login email for the SMTP server.
- Dkim
Key intSize - Dkim
Selector string - bool
- Open
Tracking bool - Region string
- Smtp
Password string The password to the SMTP server.
- Spam
Action string The spam filtering setting.
- Wildcard bool
Whether or not the domain will accept email for sub-domains.
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
The name of the record.
- Receiving
Records []GetDomain Receiving Record A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- Receiving
Records []GetSets Domain Receiving Records Set - Sending
Records []GetDomain Sending Record A list of DNS records for sending validation.
Use
sending_records_set
instead.- Sending
Records []GetSets Domain Sending Records Set - Smtp
Login string The login email for the SMTP server.
- Dkim
Key intSize - Dkim
Selector string - bool
- Open
Tracking bool - Region string
- Smtp
Password string The password to the SMTP server.
- Spam
Action string The spam filtering setting.
- Wildcard bool
Whether or not the domain will accept email for sub-domains.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The name of the record.
- receiving
Records List<GetDomain Receiving Record> A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- receiving
Records List<GetSets Domain Receiving Records Set> - sending
Records List<GetDomain Sending Record> A list of DNS records for sending validation.
Use
sending_records_set
instead.- sending
Records List<GetSets Domain Sending Records Set> - smtp
Login String The login email for the SMTP server.
- dkim
Key IntegerSize - dkim
Selector String - Boolean
- open
Tracking Boolean - region String
- smtp
Password String The password to the SMTP server.
- spam
Action String The spam filtering setting.
- wildcard Boolean
Whether or not the domain will accept email for sub-domains.
- id string
The provider-assigned unique ID for this managed resource.
- name string
The name of the record.
- receiving
Records GetDomain Receiving Record[] A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- receiving
Records GetSets Domain Receiving Records Set[] - sending
Records GetDomain Sending Record[] A list of DNS records for sending validation.
Use
sending_records_set
instead.- sending
Records GetSets Domain Sending Records Set[] - smtp
Login string The login email for the SMTP server.
- dkim
Key numberSize - dkim
Selector string - boolean
- open
Tracking boolean - region string
- smtp
Password string The password to the SMTP server.
- spam
Action string The spam filtering setting.
- wildcard boolean
Whether or not the domain will accept email for sub-domains.
- id str
The provider-assigned unique ID for this managed resource.
- name str
The name of the record.
- receiving_
records Sequence[GetDomain Receiving Record] A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- receiving_
records_ Sequence[Getsets Domain Receiving Records Set] - sending_
records Sequence[GetDomain Sending Record] A list of DNS records for sending validation.
Use
sending_records_set
instead.- sending_
records_ Sequence[Getsets Domain Sending Records Set] - smtp_
login str The login email for the SMTP server.
- dkim_
key_ intsize - dkim_
selector str - bool
- open_
tracking bool - region str
- smtp_
password str The password to the SMTP server.
- spam_
action str The spam filtering setting.
- wildcard bool
Whether or not the domain will accept email for sub-domains.
- id String
The provider-assigned unique ID for this managed resource.
- name String
The name of the record.
- receiving
Records List<Property Map> A list of DNS records for receiving validation.
Use
receiving_records_set
instead.- receiving
Records List<Property Map>Sets - sending
Records List<Property Map> A list of DNS records for sending validation.
Use
sending_records_set
instead.- sending
Records List<Property Map>Sets - smtp
Login String The login email for the SMTP server.
- dkim
Key NumberSize - dkim
Selector String - Boolean
- open
Tracking Boolean - region String
- smtp
Password String The password to the SMTP server.
- spam
Action String The spam filtering setting.
- wildcard Boolean
Whether or not the domain will accept email for sub-domains.
Supporting Types
GetDomainReceivingRecord
- 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.
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 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.
GetDomainSendingRecord
- 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.
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 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
mailgun
Terraform Provider.