azure logo
Azure Classic v5.43.0, May 6 23

azure.privatedns.getDnsZone

Explore with Pulumi AI

Use this data source to access information about an existing Private DNS Zone.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.PrivateDns.GetDnsZone.Invoke(new()
    {
        Name = "contoso.internal",
        ResourceGroupName = "contoso-dns",
    });

    return new Dictionary<string, object?>
    {
        ["privateDnsZoneId"] = example.Apply(getDnsZoneResult => getDnsZoneResult.Id),
    };
});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := privatedns.GetDnsZone(ctx, &privatedns.GetDnsZoneArgs{
			Name:              "contoso.internal",
			ResourceGroupName: pulumi.StringRef("contoso-dns"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("privateDnsZoneId", example.Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.privatedns.PrivatednsFunctions;
import com.pulumi.azure.privatedns.inputs.GetDnsZoneArgs;
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 example = PrivatednsFunctions.getDnsZone(GetDnsZoneArgs.builder()
            .name("contoso.internal")
            .resourceGroupName("contoso-dns")
            .build());

        ctx.export("privateDnsZoneId", example.applyValue(getDnsZoneResult -> getDnsZoneResult.id()));
    }
}
import pulumi
import pulumi_azure as azure

example = azure.privatedns.get_dns_zone(name="contoso.internal",
    resource_group_name="contoso-dns")
pulumi.export("privateDnsZoneId", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.privatedns.getDnsZone({
    name: "contoso.internal",
    resourceGroupName: "contoso-dns",
});
export const privateDnsZoneId = example.then(example => example.id);
variables:
  example:
    fn::invoke:
      Function: azure:privatedns:getDnsZone
      Arguments:
        name: contoso.internal
        resourceGroupName: contoso-dns
outputs:
  privateDnsZoneId: ${example.id}

Using getDnsZone

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 getDnsZone(args: GetDnsZoneArgs, opts?: InvokeOptions): Promise<GetDnsZoneResult>
function getDnsZoneOutput(args: GetDnsZoneOutputArgs, opts?: InvokeOptions): Output<GetDnsZoneResult>
def get_dns_zone(name: Optional[str] = None,
                 resource_group_name: Optional[str] = None,
                 tags: Optional[Mapping[str, str]] = None,
                 opts: Optional[InvokeOptions] = None) -> GetDnsZoneResult
def get_dns_zone_output(name: Optional[pulumi.Input[str]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetDnsZoneResult]
func GetDnsZone(ctx *Context, args *GetDnsZoneArgs, opts ...InvokeOption) (*GetDnsZoneResult, error)
func GetDnsZoneOutput(ctx *Context, args *GetDnsZoneOutputArgs, opts ...InvokeOption) GetDnsZoneResultOutput

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

public static class GetDnsZone 
{
    public static Task<GetDnsZoneResult> InvokeAsync(GetDnsZoneArgs args, InvokeOptions? opts = null)
    public static Output<GetDnsZoneResult> Invoke(GetDnsZoneInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDnsZoneResult> getDnsZone(GetDnsZoneArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azure:privatedns/getDnsZone:getDnsZone
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of the Private DNS Zone.

ResourceGroupName string

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

Tags Dictionary<string, string>

A mapping of tags for the zone.

Name string

The name of the Private DNS Zone.

ResourceGroupName string

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

Tags map[string]string

A mapping of tags for the zone.

name String

The name of the Private DNS Zone.

resourceGroupName String

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

tags Map<String,String>

A mapping of tags for the zone.

name string

The name of the Private DNS Zone.

resourceGroupName string

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

tags {[key: string]: string}

A mapping of tags for the zone.

name str

The name of the Private DNS Zone.

resource_group_name str

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

tags Mapping[str, str]

A mapping of tags for the zone.

name String

The name of the Private DNS Zone.

resourceGroupName String

The Name of the Resource Group where the Private DNS Zone exists. If the Name of the Resource Group is not provided, the first Private DNS Zone from the list of Private DNS Zones in your subscription that matches name will be returned.

tags Map<String>

A mapping of tags for the zone.

getDnsZone Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

MaxNumberOfRecordSets int

Maximum number of recordsets that can be created in this Private Zone.

MaxNumberOfVirtualNetworkLinks int

Maximum number of Virtual Networks that can be linked to this Private Zone.

MaxNumberOfVirtualNetworkLinksWithRegistration int

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

Name string
NumberOfRecordSets int

The number of recordsets currently in the zone.

ResourceGroupName string
Tags Dictionary<string, string>

A mapping of tags for the zone.

Id string

The provider-assigned unique ID for this managed resource.

MaxNumberOfRecordSets int

Maximum number of recordsets that can be created in this Private Zone.

MaxNumberOfVirtualNetworkLinks int

Maximum number of Virtual Networks that can be linked to this Private Zone.

MaxNumberOfVirtualNetworkLinksWithRegistration int

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

Name string
NumberOfRecordSets int

The number of recordsets currently in the zone.

ResourceGroupName string
Tags map[string]string

A mapping of tags for the zone.

id String

The provider-assigned unique ID for this managed resource.

maxNumberOfRecordSets Integer

Maximum number of recordsets that can be created in this Private Zone.

maxNumberOfVirtualNetworkLinks Integer

Maximum number of Virtual Networks that can be linked to this Private Zone.

maxNumberOfVirtualNetworkLinksWithRegistration Integer

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

name String
numberOfRecordSets Integer

The number of recordsets currently in the zone.

resourceGroupName String
tags Map<String,String>

A mapping of tags for the zone.

id string

The provider-assigned unique ID for this managed resource.

maxNumberOfRecordSets number

Maximum number of recordsets that can be created in this Private Zone.

maxNumberOfVirtualNetworkLinks number

Maximum number of Virtual Networks that can be linked to this Private Zone.

maxNumberOfVirtualNetworkLinksWithRegistration number

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

name string
numberOfRecordSets number

The number of recordsets currently in the zone.

resourceGroupName string
tags {[key: string]: string}

A mapping of tags for the zone.

id str

The provider-assigned unique ID for this managed resource.

max_number_of_record_sets int

Maximum number of recordsets that can be created in this Private Zone.

max_number_of_virtual_network_links int

Maximum number of Virtual Networks that can be linked to this Private Zone.

max_number_of_virtual_network_links_with_registration int

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

name str
number_of_record_sets int

The number of recordsets currently in the zone.

resource_group_name str
tags Mapping[str, str]

A mapping of tags for the zone.

id String

The provider-assigned unique ID for this managed resource.

maxNumberOfRecordSets Number

Maximum number of recordsets that can be created in this Private Zone.

maxNumberOfVirtualNetworkLinks Number

Maximum number of Virtual Networks that can be linked to this Private Zone.

maxNumberOfVirtualNetworkLinksWithRegistration Number

Maximum number of Virtual Networks that can be linked to this Private Zone with registration enabled.

name String
numberOfRecordSets Number

The number of recordsets currently in the zone.

resourceGroupName String
tags Map<String>

A mapping of tags for the zone.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.