Azure DNS SRV Record
This page shows how to write Terraform and Azure Resource Manager for DNS SRV Record and write them securely.
azurerm_dns_srv_record (Terraform)
The SRV Record in DNS can be configured in Terraform with the resource name azurerm_dns_srv_record
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_dns_srv_record" "dns_srv_record_1" {
name = "_sip._tls"
zone_name = azurerm_dns_zone.dns_zone.name
resource_group_name = azurerm_resource_group.resource_group.name
ttl = var.default_ttl
resource "azurerm_dns_srv_record" "over1B" {
name = "test"
zone_name = azurerm_dns_zone.example.name
resource_group_name = azurerm_resource_group.example.name
ttl = 300
resource "azurerm_dns_srv_record" "sip_tls" {
name = "_sip._tls"
zone_name = var.zone_name
resource_group_name = var.rg_name
ttl = 3600
resource "azurerm_dns_srv_record" "over1B" {
name = "test"
zone_name = azurerm_dns_zone.example.name
resource_group_name = azurerm_resource_group.example.name
ttl = 300
resource "azurerm_dns_srv_record" "this" {
for_each = { for record in var.srv_recordsets :
record.name => record
}
resource_group_name = lower(var.resource_group_name)
resource "azurerm_dns_srv_record" "srv" {
for_each = try(var.records.srv, {})
name = each.value.name
zone_name = var.zone_name
resource_group_name = var.resource_group_name
resource "azurerm_dns_srv_record" "srv" {
for_each = try(var.records.srv, {})
name = each.value.name
zone_name = var.zone_name
resource_group_name = var.resource_group_name
resource "azurerm_dns_srv_record" "srv" {
for_each = try(var.records.srv, {})
name = each.value.name
zone_name = var.zone_name
resource_group_name = var.resource_group_name
resource "azurerm_dns_srv_record" "pain_td00_srv" {
name = "_autoconfig"
zone_name = azurerm_dns_zone.openinfrastructure_dns.name
resource_group_name = azurerm_resource_group.openinfrastructure_rg.name
ttl = 3600
record {
resource "azurerm_dns_srv_record" "this" {
for_each = {
for records, record in var.dns_records : records => record
if record.type == "SRV"
}
Parameters
-
fqdn
optional computed - string -
id
optional computed - string -
name
required - string -
resource_group_name
required - string -
tags
optional - map from string to string -
ttl
required - number -
zone_name
required - string -
record
set block -
timeouts
single block
Explanation in Terraform Registry
Enables you to manage DNS SRV Records within Azure DNS.
Microsoft.Network/dnszones/SRV (Azure Resource Manager)
The dnszones/SRV in Microsoft.Network can be configured in Azure Resource Manager with the resource name Microsoft.Network/dnszones/SRV
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
"type": "Microsoft.Network/dnszones/SRV",
"name": "[concat(parameters('dnsZoneName'),'/','_sipfederationtls._tcp')]",
"apiVersion": "2016-04-01",
"properties": {
"TTL": "[parameters('ttl')]",
"SRVRecords": [
Frequently asked questions
What is Azure DNS SRV Record?
Azure DNS SRV Record is a resource for DNS of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure DNS SRV Record?
For Terraform, the cbchalmers/Azure-SaaS-DNS-Public-Zone-M365-Records, gilyas/infracost and Diehlabs/terraform-azurerm-o365dns source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the RTmtfiallos/ABCDS-AKS-NAT-AGIC, net9876/azure-quickstart-templates and Somphodj/azure source code examples are useful. See the Azure Resource Manager Example section for further details.