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

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

azure.privatedns.getCnameRecord

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi

Example Usage

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

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

example = azure.privatedns.CnameRecord("example",
    name="test",
    zone_name="test-zone",
    resource_group_name="test-rg")
pulumi.export("privateDnsCnameRecordId", example_azurerm_private_dns_cname_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.NewCnameRecord(ctx, "example", &privatedns.CnameRecordArgs{
			Name:              pulumi.String("test"),
			ZoneName:          pulumi.String("test-zone"),
			ResourceGroupName: pulumi.String("test-rg"),
		})
		if err != nil {
			return err
		}
		ctx.Export("privateDnsCnameRecordId", exampleAzurermPrivateDnsCnameRecord.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.CnameRecord("example", new()
    {
        Name = "test",
        ZoneName = "test-zone",
        ResourceGroupName = "test-rg",
    });

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

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

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

Using getCnameRecord

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 getCnameRecord(args: GetCnameRecordArgs, opts?: InvokeOptions): Promise<GetCnameRecordResult>
function getCnameRecordOutput(args: GetCnameRecordOutputArgs, opts?: InvokeOptions): Output<GetCnameRecordResult>
Copy
def get_cname_record(name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     zone_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetCnameRecordResult
def get_cname_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[GetCnameRecordResult]
Copy
func LookupCnameRecord(ctx *Context, args *LookupCnameRecordArgs, opts ...InvokeOption) (*LookupCnameRecordResult, error)
func LookupCnameRecordOutput(ctx *Context, args *LookupCnameRecordOutputArgs, opts ...InvokeOption) LookupCnameRecordResultOutput
Copy

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

public static class GetCnameRecord 
{
    public static Task<GetCnameRecordResult> InvokeAsync(GetCnameRecordArgs args, InvokeOptions? opts = null)
    public static Output<GetCnameRecordResult> Invoke(GetCnameRecordInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetCnameRecordResult> getCnameRecord(GetCnameRecordArgs args, InvokeOptions options)
public static Output<GetCnameRecordResult> getCnameRecord(GetCnameRecordArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:privatedns/getCnameRecord:getCnameRecord
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Private DNS CNAME 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 This property is required. string
The name of the Private DNS CNAME 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 This property is required. String
The name of the Private DNS CNAME 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 This property is required. string
The name of the Private DNS CNAME 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 This property is required. str
The name of the Private DNS CNAME 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 This property is required. String
The name of the Private DNS CNAME 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.

getCnameRecord Result

The following output properties are available:

Fqdn string
The FQDN of the Private DNS CName Record.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Record string
The target of the CNAME.
ResourceGroupName string
Tags Dictionary<string, string>
A mapping of tags assigned to the resource.
TargetResourceId string
Ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
ZoneName string
Fqdn string
The FQDN of the Private DNS CName Record.
Id string
The provider-assigned unique ID for this managed resource.
Name string
Record string
The target of the CNAME.
ResourceGroupName string
Tags map[string]string
A mapping of tags assigned to the resource.
TargetResourceId string
Ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
ZoneName string
fqdn String
The FQDN of the Private DNS CName Record.
id String
The provider-assigned unique ID for this managed resource.
name String
record String
The target of the CNAME.
resourceGroupName String
tags Map<String,String>
A mapping of tags assigned to the resource.
targetResourceId String
ttl Integer
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName String
fqdn string
The FQDN of the Private DNS CName Record.
id string
The provider-assigned unique ID for this managed resource.
name string
record string
The target of the CNAME.
resourceGroupName string
tags {[key: string]: string}
A mapping of tags assigned to the resource.
targetResourceId string
ttl number
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName string
fqdn str
The FQDN of the Private DNS CName Record.
id str
The provider-assigned unique ID for this managed resource.
name str
record str
The target of the CNAME.
resource_group_name str
tags Mapping[str, str]
A mapping of tags assigned to the resource.
target_resource_id str
ttl int
The Time To Live (TTL) of the Private DNS record in seconds.
zone_name str
fqdn String
The FQDN of the Private DNS CName Record.
id String
The provider-assigned unique ID for this managed resource.
name String
record String
The target of the CNAME.
resourceGroupName String
tags Map<String>
A mapping of tags assigned to the resource.
targetResourceId String
ttl Number
The Time To Live (TTL) of the Private DNS record in seconds.
zoneName String

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.21.0 published on Friday, Mar 7, 2025 by Pulumi