Skip to main content
Providers

DnsRecordSet

A resource of the Azure provider, version 0.3.0, in its DNS group. Import it with:

import DnsRecordSet from "azure/dns"

Example

resource DnsRecordSet example {
    zoneName         = "example-value"
    resourceGroup    = "example-value"
    name             = "example-value"
    type             = "A"
    ttl              = 3.14
    aRecords         = "..."
    aaaaRecords      = "..."
    cnameRecord      = "example-value"
    mxRecords        = "..."
    txtRecords       = "..."
    nsRecords        = "..."
    srvRecords       = "..."
    caaRecords       = "..."
    ptrRecords       = "..."
    targetResourceId = "example-value"
    metadata         = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
zoneNamestring—NoThe name of the DNS zone
resourceGroupstring—NoThe resource group name
namestring—NoThe name of the record set. Use @ for the zone apex
typestring—NoThe DNS record type Allowed: "A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV", "CAA", "PTR", "SOA"
ttlnumber—NoThe TTL (time to live) in seconds. Required unless targetResourceId is specified
aRecordsany[]—NoA records (IPv4 addresses). Used when type = A
aaaaRecordsany[]—NoAAAA records (IPv6 addresses). Used when type = AAAA
cnameRecordstring—NoCNAME record (canonical name). Used when type = CNAME
mxRecordsany[]—NoMX records. Used when type = MX
txtRecordsany[]—NoTXT records. Used when type = TXT
nsRecordsany[]—NoNS records. Used when type = NS
srvRecordsany[]—NoSRV records. Used when type = SRV
caaRecordsany[]—NoCAA records. Used when type = CAA
ptrRecordsany[]—NoPTR records. Used when type = PTR
targetResourceIdstring—NoTarget resource ID for alias record. Points to an Azure resource (e.g., Public IP, Traffic Manager)
metadataobject—NoMetadata for the record set

Set by Azure after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
idstringYesThe resource ID of the record set
fqdnstringNoThe fully qualified domain name of the record set
provisioningStatestringNoThe provisioning state
etagstringNoThe ETag of the record set

On this page