getZone

suspend fun getZone(argument: GetZonePlainArgs): GetZoneResult

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

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.dns.getZone({
name: "search-eventhubns",
resourceGroupName: "search-service",
});
export const dnsZoneId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.dns.get_zone(name="search-eventhubns",
resource_group_name="search-service")
pulumi.export("dnsZoneId", example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Dns.GetZone.Invoke(new()
{
Name = "search-eventhubns",
ResourceGroupName = "search-service",
});
return new Dictionary<string, object?>
{
["dnsZoneId"] = example.Apply(getZoneResult => getZoneResult.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := dns.LookupZone(ctx, &dns.LookupZoneArgs{
Name: "search-eventhubns",
ResourceGroupName: pulumi.StringRef("search-service"),
}, nil)
if err != nil {
return err
}
ctx.Export("dnsZoneId", example.Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.dns.DnsFunctions;
import com.pulumi.azure.dns.inputs.GetZoneArgs;
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 = DnsFunctions.getZone(GetZoneArgs.builder()
.name("search-eventhubns")
.resourceGroupName("search-service")
.build());
ctx.export("dnsZoneId", example.applyValue(getZoneResult -> getZoneResult.id()));
}
}
variables:
example:
fn::invoke:
function: azure:dns:getZone
arguments:
name: search-eventhubns
resourceGroupName: search-service
outputs:
dnsZoneId: ${example.id}

Return

A collection of values returned by getZone.

Parameters

argument

A collection of arguments for invoking getZone.


suspend fun getZone(name: String, resourceGroupName: String? = null): GetZoneResult

Return

A collection of values returned by getZone.

Parameters

name

The name of the DNS Zone.

resourceGroupName

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

See also


suspend fun getZone(argument: suspend GetZonePlainArgsBuilder.() -> Unit): GetZoneResult

Return

A collection of values returned by getZone.

Parameters

argument

Builder for com.pulumi.azure.dns.kotlin.inputs.GetZonePlainArgs.

See also