hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.59k stars 4.63k forks source link

azurerm_public_ip - Support setting domain label scope #27730

Open audunsolemdal opened 2 days ago

audunsolemdal commented 2 days ago

Is there an existing issue for this?

Community Note

Description

Would like a new optional paramteer which can set the "domain name label scope" on public IP address resources to avoid risk related to dangling DNS names.

Supported values are

"NoReuse"
"ResourceGroupReuse"
"SubscriptionReuse"
"TenantReuse"

This must be set upon creation of the resource

The API has supported setting this since provider version "Microsoft.Network/publicIPAddresses@2022-11-01", the feature is currently in public preview.

New or Affected Resource(s)/Data Source(s)

azurerm_public_ip

Potential Terraform Configuration

resource "azurerm_public_ip" "example" {
  name                = "acceptanceTestPublicIp1"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  allocation_method   = "Static"
  domain_label_scope = "TenantReuse" # The domain name label scope can only be specified at the creation of a public IP address
}

References

https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses?branch=pr-en-us-268827#domain-name-label-scope-preview https://learn.microsoft.com/en-us/azure/templates/microsoft.network/publicipaddresses?pivots=deployment-language-terraform

sinbai commented 1 day ago

Hi @audunsolemdal thanks for opening this issue. PR has been submitted to support domain_label_name_scope. Could you please track it for more updates?