Terraform-provider-azurerm: Azure DNS Alias records

Created on 10 Jun 2019  ·  6Comments  ·  Source: terraform-providers/terraform-provider-azurerm

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Support Alias records in Azure DNS for public zones. This feature allows referencing other Azure resources from within their DNS zones such that the DNS records get updated automatically when there is a lifecycle event on the referenced Azure resources.

Sample ARM template block:

{
    "type": "Microsoft.Network/dnszones/A",
    "apiVersion": "2018-05-01",
    "name": "[concat(parameters('dnszones_bla.foo_name'), '/@')]",
    "dependsOn": [
         "[resourceId('Microsoft.Network/dnszones', parameters('dnszones_bla.foo_name'))]"
    ],
    "properties": {
         "TTL": 3600,
         "targetResource": {
             "id": "[concat(parameters('profiles_cdnprofileabc_externalid'), '/endpoints/blafoobar')]"
         }
     }
},

New or Affected Resource(s)

  • azurerm_dns_a_record
  • azurerm_dns_aaaa_record
  • azurerm_dns_cname_record

Potential Terraform Configuration

resource "azurerm_dns_a_record" "test" {
  name                = "test"
  zone_name           = "${azurerm_dns_zone.test.name}"
  resource_group_name = "${azurerm_resource_group.test.name}"
  ttl                 = 300
  targetResource      = "${azurerm_cdn_endpoint.test.name}"
}

References

enhancement servicdns

Most helpful comment

I'm also affected by this. My use case requires the '@' record creating to enable aliasing at the zone level. Something like this:

resource "azurerm_dns_a_record" "test" {
  name                = "@"
  zone_name           = "${azurerm_dns_zone.test.name}"
  resource_group_name = "${azurerm_resource_group.test.name}"
  ttl                 = 300
  target_resource_id  = "${azurerm_cdn_endpoint.test.id}"
}

All 6 comments

FYI, this will require an update of the SDK version

I'm also affected by this. My use case requires the '@' record creating to enable aliasing at the zone level. Something like this:

resource "azurerm_dns_a_record" "test" {
  name                = "@"
  zone_name           = "${azurerm_dns_zone.test.name}"
  resource_group_name = "${azurerm_resource_group.test.name}"
  ttl                 = 300
  target_resource_id  = "${azurerm_cdn_endpoint.test.id}"
}

I have started taking a look at this: matt-FFFFFF/terraform-provider-azurerm#2

Initial testing with A records has been successful.

5133

This has been released in version 1.40.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.40.0"
}
# ... other configuration ...

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings