get Cname Record
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.dns.getCnameRecord({
name: "test",
zoneName: "test-zone",
resourceGroupName: "test-rg",
});
export const dnsCnameRecordId = example.then(example => example.id);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.dns.get_cname_record(name="test",
zone_name="test-zone",
resource_group_name="test-rg")
pulumi.export("dnsCnameRecordId", example.id)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Dns.GetCnameRecord.Invoke(new()
{
Name = "test",
ZoneName = "test-zone",
ResourceGroupName = "test-rg",
});
return new Dictionary<string, object?>
{
["dnsCnameRecordId"] = example.Apply(getCnameRecordResult => getCnameRecordResult.Id),
};
});
Content copied to clipboard
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.GetCnameRecord(ctx, &dns.GetCnameRecordArgs{
Name: "test",
ZoneName: "test-zone",
ResourceGroupName: "test-rg",
}, nil)
if err != nil {
return err
}
ctx.Export("dnsCnameRecordId", example.Id)
return nil
})
}
Content copied to clipboard
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.GetCnameRecordArgs;
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.getCnameRecord(GetCnameRecordArgs.builder()
.name("test")
.zoneName("test-zone")
.resourceGroupName("test-rg")
.build());
ctx.export("dnsCnameRecordId", example.applyValue(getCnameRecordResult -> getCnameRecordResult.id()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:dns:getCnameRecord
arguments:
name: test
zoneName: test-zone
resourceGroupName: test-rg
outputs:
dnsCnameRecordId: ${example.id}
Content copied to clipboard
Return
A collection of values returned by getCnameRecord.
Parameters
argument
A collection of arguments for invoking getCnameRecord.
suspend fun getCnameRecord(name: String, resourceGroupName: String, zoneName: String): GetCnameRecordResult
Return
A collection of values returned by getCnameRecord.
Parameters
name
The name of the DNS CNAME Record.
resource Group Name
Specifies the resource group where the DNS Zone (parent resource) exists.
zone Name
Specifies the DNS Zone where the resource exists.
See also
suspend fun getCnameRecord(argument: suspend GetCnameRecordPlainArgsBuilder.() -> Unit): GetCnameRecordResult
Return
A collection of values returned by getCnameRecord.
Parameters
argument
Builder for com.pulumi.azure.dns.kotlin.inputs.GetCnameRecordPlainArgs.