1. Packages
  2. Azure Classic
  3. API Docs
  4. privatedns
  5. getMxRecord

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.privatedns.getMxRecord

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.privatedns.MxRecord("example", {
    name: "test",
    zoneName: "test-zone",
    resourceGroupName: "test-rg",
});
export const privateDnsMxRecordId = exampleAzurermPrivateDnsMxRecord.id;
Copy
import pulumi
import pulumi_azure as azure

example = azure.privatedns.MxRecord("example",
    name="test",
    zone_name="test-zone",
    resource_group_name="test-rg")
pulumi.export("privateDnsMxRecordId", example_azurerm_private_dns_mx_record["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/privatedns"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := privatedns.NewMxRecord(ctx, "example", &privatedns.MxRecordArgs{
			Name:              pulumi.String("test"),
			ZoneName:          pulumi.String("test-zone"),
			ResourceGroupName: pulumi.String("test-rg"),
		})
		if err != nil {
			return err
		}
		ctx.Export("privateDnsMxRecordId", exampleAzurermPrivateDnsMxRecord.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.PrivateDns.MxRecord("example", new()
    {
        Name = "test",
        ZoneName = "test-zone",
        ResourceGroupName = "test-rg",
    });

    return new Dictionary<string, object?>
    {
        ["privateDnsMxRecordId"] = exampleAzurermPrivateDnsMxRecord.Id,
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.privatedns.MxRecord;
import com.pulumi.azure.privatedns.MxRecordArgs;
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) {
        var example = new MxRecord("example", MxRecordArgs.builder()
            .name("test")
            .zoneName("test-zone")
            .resourceGroupName("test-rg")
            .build());

        ctx.export("privateDnsMxRecordId", exampleAzurermPrivateDnsMxRecord.id());
    }
}
Copy
resources:
  example:
    type: azure:privatedns:MxRecord
    properties:
      name: test
      zoneName: test-zone
      resourceGroupName: test-rg
outputs:
  privateDnsMxRecordId: ${exampleAzurermPrivateDnsMxRecord.id}
Copy

Using getMxRecord

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 getMxRecord(args: GetMxRecordArgs, opts?: InvokeOptions): Promise<GetMxRecordResult>
function getMxRecordOutput(args: GetMxRecordOutputArgs, opts?: InvokeOptions): Output<GetMxRecordResult>
Copy
def get_mx_record(name: Optional[str] = None,
                  resource_group_name: Optional[str] = None,
                  zone_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetMxRecordResult
def get_mx_record_output(name: Optional[pulumi.Input[str]] = None,
                  resource_group_name: Optional[pulumi.Input[str]] = None,
                  zone_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetMxRecordResult]
Copy
func LookupMxRecord(ctx *Context, args *LookupMxRecordArgs, opts ...InvokeOption) (*LookupMxRecordResult, error)
func LookupMxRecordOutput(ctx *Context, args *LookupMxRecordOutputArgs, opts ...InvokeOption) LookupMxRecordResultOutput
Copy

> Note: This function is named LookupMxRecord in the Go SDK.

public static class GetMxRecord 
{
    public static Task<GetMxRecordResult> InvokeAsync(GetMxRecordArgs args, InvokeOptions? opts = null)
    public static Output<GetMxRecordResult> Invoke(GetMxRecordInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetMxRecordResult> getMxRecord(GetMxRecordArgs args, InvokeOptions options)
public static Output<GetMxRecordResult> getMxRecord(GetMxRecordArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:privatedns/getMxRecord:getMxRecord
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceGroupName This property is required. string
Specifies the resource group where the Private DNS Zone (parent resource) exists.
ZoneName This property is required. string
Specifies the Private DNS Zone where the resource exists.
Name string
The name of the Private DNS MX Record.
ResourceGroupName This property is required. string
Specifies the resource group where the Private DNS Zone (parent resource) exists.
ZoneName This property is required. string
Specifies the Private DNS Zone where the resource exists.
Name string
The name of the Private DNS MX Record.
resourceGroupName This property is required. String
Specifies the resource group where the Private DNS Zone (parent resource) exists.
zoneName This property is required. String
Specifies the Private DNS Zone where the resource exists.
name String
The name of the Private DNS MX Record.
resourceGroupName This property is required. string
Specifies the resource group where the Private DNS Zone (parent resource) exists.
zoneName This property is required. string
Specifies the Private DNS Zone where the resource exists.
name string
The name of the Private DNS MX Record.
resource_group_name This property is required. str
Specifies the resource group where the Private DNS Zone (parent resource) exists.
zone_name This property is required. str
Specifies the Private DNS Zone where the resource exists.
name str
The name of the Private DNS MX Record.
resourceGroupName This property is required. String
Specifies the resource group where the Private DNS Zone (parent resource) exists.
zoneName This property is required. String
Specifies the Private DNS Zone where the resource exists.
name String
The name of the Private DNS MX Record.

getMxRecord Result

The following output properties are available:

Fqdn string
The FQDN of the Private DNS MX Record.
Id string
The provider-assigned unique ID for this managed resource.
Records List<GetMxRecordRecord>
A list of values that make up the MX record. Each record block supports fields documented below.
ResourceGroupName string
Tags Dictionary<string, string>
A mapping of tags assigned to the resource.
Ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
ZoneName string
Name string
Fqdn string
The FQDN of the Private DNS MX Record.
Id string
The provider-assigned unique ID for this managed resource.
Records []GetMxRecordRecord
A list of values that make up the MX record. Each record block supports fields documented below.
ResourceGroupName string
Tags map[string]string
A mapping of tags assigned to the resource.
Ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
ZoneName string
Name string
fqdn String
The FQDN of the Private DNS MX Record.
id String
The provider-assigned unique ID for this managed resource.
records List<GetMxRecordRecord>
A list of values that make up the MX record. Each record block supports fields documented below.
resourceGroupName String
tags Map<String,String>
A mapping of tags assigned to the resource.
ttl Integer
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName String
name String
fqdn string
The FQDN of the Private DNS MX Record.
id string
The provider-assigned unique ID for this managed resource.
records GetMxRecordRecord[]
A list of values that make up the MX record. Each record block supports fields documented below.
resourceGroupName string
tags {[key: string]: string}
A mapping of tags assigned to the resource.
ttl number
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName string
name string
fqdn str
The FQDN of the Private DNS MX Record.
id str
The provider-assigned unique ID for this managed resource.
records Sequence[GetMxRecordRecord]
A list of values that make up the MX record. Each record block supports fields documented below.
resource_group_name str
tags Mapping[str, str]
A mapping of tags assigned to the resource.
ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
zone_name str
name str
fqdn String
The FQDN of the Private DNS MX Record.
id String
The provider-assigned unique ID for this managed resource.
records List<Property Map>
A list of values that make up the MX record. Each record block supports fields documented below.
resourceGroupName String
tags Map<String>
A mapping of tags assigned to the resource.
ttl Number
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName String
name String

Supporting Types

GetMxRecordRecord

Exchange This property is required. string
The mail server responsible for the domain covered by the MX record.
Preference This property is required. int
String representing the "preference” value of the MX records. Records with lower preference value take priority.
Exchange This property is required. string
The mail server responsible for the domain covered by the MX record.
Preference This property is required. int
String representing the "preference” value of the MX records. Records with lower preference value take priority.
exchange This property is required. String
The mail server responsible for the domain covered by the MX record.
preference This property is required. Integer
String representing the "preference” value of the MX records. Records with lower preference value take priority.
exchange This property is required. string
The mail server responsible for the domain covered by the MX record.
preference This property is required. number
String representing the "preference” value of the MX records. Records with lower preference value take priority.
exchange This property is required. str
The mail server responsible for the domain covered by the MX record.
preference This property is required. int
String representing the "preference” value of the MX records. Records with lower preference value take priority.
exchange This property is required. String
The mail server responsible for the domain covered by the MX record.
preference This property is required. Number
String representing the "preference” value of the MX records. Records with lower preference value take priority.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi